httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Sussman <>
Subject Re: Win32 Progress Report
Date Tue, 06 Aug 1996 08:27:04 GMT
> On Mon, 5 Aug 1996 wrote:
> > >          RST                                         MT
> > > 
> > >    The server stops responding to         The server only has one request
> > >    other requests whilst executing        executing unsafe code at any one
> > >    the unsafe code.                       time.
> > 
> > All I was saying was that it is easier to block a thread from executing
> > an unsafe library call in rstthreads than it is in pre-emptive MT.
> Not really. In POSIX threads, for example, all you need to do is the
> following:
> 1. Declare somewhere:
> static mutex_t my_mutex;
> 2. Before calling this unsafe library call, say:
> mutex_lock(&my_mutex);
> 3. After calling the unsafe library call, say:
> mutex_unlock(&my_mutex);
> Should work like a charm. The one problem is if, for example, two
> different modules both wanted to call the same function; they'd have to
> agree to use the same mutex, otherwise they could both call the function
> in different threads at the same time.

I can already think of a couple of places this would happen.  There are
several modules which make use of msql and Postgres95 at the same time
and it is pretty natural to have more than one compiled in.
While a threadsafe version of the Postgres95 library is on the TODO
list of the current developement group, I can't predict when it will be
available.  I can't speak for mSQL at all.

I'm sure there are more examples to be found.

Would it be possible perhaps to have some sort of central mutex registry
for unsafe library calls keyed by function names?


View raw message