httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@organic.com>
Subject Re: Win32 Progress Report
Date Tue, 06 Aug 1996 18:29:32 GMT
On Tue, 6 Aug 1996, Adam Sussman wrote:

> > 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?

Probably. This is a political issue, though, not a technical issue. There
just needs to be some sort of agreement (possibly facilitated by the
Apache Group - I agree that it might be beneficial to have a mutex
registry on www.apache.org) that ensures that everyone who uses mSQL uses: 

extern pthread_mutex_t msql_mutex;

The only problem I can think of is with initilazation of the mutex.
Namely, it needs to be done, and someone has to do it. I don't think it
would be a problem if everyone ran pthread_mutex_init(&msql_mutex, NULL)
(again, I'm using the POSIX threads version), because that's really just
the same as msql_mutex = calloc(1, sizeof (pthread_mutex_t)); And since
the server is in single-thread mode when it initializes, the mutex doesn't
need to be used to access the thread-unsafe library. So it'd be okay to
initalize it several times.

(someone correct me if I'm wrong).

-- Alexei Kosut <akosut@organic.com>            The Apache HTTP Server 
   http://www.nueva.pvt.k12.ca.us/~akosut/      http://www.apache.org/


Mime
View raw message