shared mem & semaphores module

Jeff Davis jdavis at
Thu Sep 19 05:08:19 EDT 2002

> mmap has no provision at all for semaphores.  Try:
> I wish the standard library would include this.

The threading module, as someone else pointed out, includes a Semaphore 
class. It seems like it might be wrapped around locking functions in the 
thread module, however, which seems strange. The one you point to seems 
like what I'd expect in the standard library.

It's good to hear that I'm not crazy for thinking that shared memory 
functions should be in the standard library.

Which brings up an interesting question: why are python libraries not more 
categorized? It would make sense to me that instead of doing "import pg" 
you should do something more like "import" so as not to clutter the 
module namespace with 50 different database drivers (mysql, postgres, 

With that model they could make us do our imports like "import unix.shm" or 
whatever and it wouldn't get in anyone's way.


More information about the Python-list mailing list