threading support in python

sjdevnull at yahoo.com sjdevnull at yahoo.com
Wed Sep 6 03:09:19 EDT 2006


Paul Rubin wrote:
> "sjdevnull at yahoo.com" <sjdevnull at yahoo.com> writes:
> > Having memory protection is superior to not having it--OS designers
> > spent years implementing it, why would you toss out a fair chunk of it?
> >  Being explicit about what you're sharing is generally better than not.
>
> Part of the win of programming in Python instead of C is having the
> language do memory management for you--no more null pointers
> dereferences or malloc/free errors.  Using shared memory puts all that
> squarely back in your lap.

Huh?  Why couldn't you use garbage collection with objects allocated in
shm?  The worst theoretical case is about the same programatically as
having garbage collected objects in a multithreaded program.

Python doesn't actually support that as of yet, but it could.  In the
interim, if the memory you're sharing is array-like then you can
already take full advantage of multiprocess solutions in Python.




More information about the Python-list mailing list