apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: condition variables in APR...
Date Wed, 01 Aug 2001 17:04:29 GMT
That would be most cool :)  Please focus this discussion, for the moment, at
the dev@apr.apache.org list instead, till we have something finished to 'share' 
with the new-httpd list :)

I certainly expect we would appreciate it, even if its final 'apr-ized' form 
looks a bit different than your existing code.

MacOS(<X) isn't supported in APR right at this moment.  David appears excited (?)
to prove this up in BEOS.  Does your code already support OS2?

Bill

----- Original Message ----- 
From: "William M. Perry" <wmperry@aventail.com>
To: <new-httpd@apache.org>
Sent: Wednesday, August 01, 2001 10:02 AM
Subject: condition variables in APR...


> My boss says it is ok to contribute the cross-platform condition variable
> code I wrote here.  It is currently not very APR like though.  It uses
> common macros defined in header files with common C code.  I can rip out
> the implementation easily into unix & win32 files though.  beos & mac will
> have to be done by someone else.  I haven't programmed on a mac in close to
> a decade. :)
> 
> Where is the best place to put this in APR?  It doesn't seem to belong in
> apr/locks/ - does it deserve its own subdirectory in APR?
> 
> For win32 this uses events:
> 
> init      -- pcond = CreateEvent(NULL,TRUE,TRUE,NULL);
> wait      -- HANDLE h[2]; h[0] = pcond; h[1] = mutex;
>      MUTEX_UNLOCK(mid);
>      WaitForMultipleObjects(2,h,TRUE,INFINITE);
> signal    -- SetEvent(pcond);
> broadcast -- ResetEvent(pcond);
> destroy   -- CloseHandle(pcond);
> 
> On unix of course we would just use the pthread_cond_xxx routines.  The
> only sticky point I see is having some way to get the underlying system
> representation from an `apr_lock_t' to pass to WaitForMultipleObjects or
> pthread_cond_wait.
> 
> Would it be sane to include locks.h and do the appropriate munging?  Nobody
> outside of the locks/ directory seems to use it (other that
> misc/unix/start.c and that is just for a forward function declaration).
> 
> -bp
> -- 
> Ceterum censeo vi esse delendam
> 




Mime
View raw message