httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: possible APIs for no-wait APR locks
Date Tue, 20 Jun 2000 04:32:49 GMT

plan b is the correct approach IMNSHO.


APR_READWRITE is supposed to specify a reader/writer lock, but nobody ever
implemented it.

Ryan

> plan a:
> 
>   ap_create_lock() interface unchanged
> 
>   ap_lock() interface unchanged
> 
>   add new ap_set_lock_nowait() function
>   (ap_set_lock_wait() could possibly be added in the future if
>   somebody needs it)
> 
> plan b:
> 
>   add new lock type parameter APR_MUTEX_NOWAIT to ap_create_lock();
>   APR_MUTEX is exactly like APR_MUTEX except that all ap_lock() calls
>   are no-wait
> 
>   (By the way... what the heck is APR_READWRITE supposed to be?  One
>   caller of ap_create_lock() specifies it, but the implementation is
>   the same.)
> 
> plan c:
> 
>   add new function ap_try_lock() which is a no-wait flavor of
>   ap_lock()
> 
>   This is nice, but the logic to check the current blocking state of
>   the lock file (fcntl() and flock()) and possibly toggle it would be
>   intermingled with the locking code.


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message