Sterling Hughes
sterling at bumblebury.com
Wed Jun 25 01:16:51 EST 2003
The way you handle locking with mmap() is by using a combination of a file and a mmap(), it isn't that expensive so long as MAP_NOSYNC is specified (if MAP_NOSYNC isn't specified than most operating systems default to it). Outside of that, the proper way to do this is to use a semaphore. -Sterling On Wed, 2003-06-25 at 00:40, Gregory (Grisha) Trubetskoy wrote: > On Tue, 24 Jun 2003 mod_python at mikebell.org wrote: > > > On Wed, Jun 25, 2003 at 12:16:29AM -0400, Gregory (Grisha) Trubetskoy wrote: > > > http://www.python.org/doc/current/lib/module-mmap.html > > > > The only problem with the mmap module is that it just gives you a > > string-like object. How do you put something like a mutex in there so > > you can access the shared memory area safely? > > > > To quote Guido - "Good question!" > > (here is the link > http://mail.python.org/pipermail/python-dev/2001-August/016772.html) > > :-) > > OK, on a serious note - I believe the shm module provides locking. I'm > also going to look into the APR for possibly including some locking > interface in the next version of mp. > > Grisha > > _______________________________________________ > Mod_python mailing list > Mod_python at modpython.org > http://mailman.modpython.org/mailman/listinfo/mod_python -- "Programming today is a race between software engineers stirring to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Unknown
|