apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject mem locking (was: Re: cvs commit: apr/memory/unix apr_sms.c)
Date Mon, 11 Jun 2001 09:42:17 GMT
This thread is getting rather long, but I don't see the motivation.

What is the requirement for this range locking? We don't have to do
everything imaginable simply because we can. Every time we load "features"
into APR(UTIL), that just means we need to maintain them. Why do we *need*
this feature? And will it be widely useful?

I'm not seeing it.

Cheers,
-g

On Mon, Jun 11, 2001 at 09:22:59AM +0100, Ben Laurie wrote:
> Luke Kenneth Casson Leighton wrote:
> > On Sat, Jun 09, 2001 at 06:34:21PM +0100, Ben Laurie wrote:
> > > Luke Kenneth Casson Leighton wrote:
> > > > uh... i thought i should point out: the original proposal
> > > > i recommended for the sms locking routine should pass
> > > > in the area of memory to be locked and its length,
> > > > and ditto for the unlocking.
> > >
> > > +1.
> > >
> > > > in this way, let's say you do mmap on a file, you can
> > > > use posix locking as the implementation of the locking
> > > > on the memory.
> > > >
> > > > [or can you?  i dunno, for sure :) ]
> > >
> > > I believe so.
> > >
> > > > and, if the argument is NULL, it means ' do a Global Lock'.
> > > >
> > > > if the unlock() argument is NULL, it means 'do a Global
> > > > Unlock - i.e. free all locks'.
> > >
> > > And if the locking mechanism doesn't support regions? (This is
> > > particularly important if you allow unlocking of subregions). The
> > > obvious answer being that we implement them in APR, of course.
> > 
> > well, that is what made me think that perhaps a separate
> > lock and lock_region be done, such that one or other
> > cold be supported.
> > 
> > or, you mandate providing locking, emulating regions by
> > ... errr.... providing ref-counting on a global lock (yuck!)
> > 
> > hm, that don't work.  nope: have to do the lock and
> > lock_region, then have a means for Users to detect
> > that a lock_region function is available / supported.
> > 
> > you know, this is all tending to suggest having a
> > 'apr_sms_get_features()' fn, returning a bitfield
> > of supported features.
> 
> You can emulate regions with global locks and shared memory, of course.
> And still tell people which you support natively.
> 
> Don't know whether its worth it - does anyone have any views?
> 
> Cheers,
> 
> Ben.
> 
> --
> http://www.apache-ssl.org/ben.html
> 
> "There is no limit to what a man can do or how far he can go if he
> doesn't mind who gets the credit." - Robert Woodruff

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message