httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@ibm.net>
Subject Re: possible APIs for no-wait APR locks
Date Tue, 20 Jun 2000 02:35:30 GMT
> Date: Mon, 19 Jun 2000 21:48:58 -0400
> From: Jeff Trawick <trawick@ibm.net>
> 
> > From: "Brian Havard" <brianh@kheldar.apana.org.au>
> > Date: Tue, 20 Jun 2000 11:22:56 +1000 (EST)
> > 
> > >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)
> > 
> > How about adding a timeout value as a parameter, 0 indicating no wait, -1
> > for indefinite. I know both OS/2 & Win32 APIs support that directly
> > (DosRequestMutexSem() & WaitForSingleObject()) though I don't know about
> > unix or BeOS.
> 
> Unfortunately, I can't tell that *any* of the lock mechanisms
> supported on Unix (SysV sem, fcntl, flock, pthread mutex) support
> timeouts natively, so it couldn't be implemented cheaply.  Perhaps an
> alarm would wake us out of certain types of lock requests but that
> isn't very cool...

That being said, I'm not opposed to it being part of the interface.
Some apps need such a construct, and if APR can provide a decent
implementation then the apps don't have to roll their own.

I guess it would be ap_set_lock_timeout()?

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message