This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author roudkerk
Recipients Rhamphoryncus, amaury.forgeotdarc, jnoller, roudkerk, theller
Date 2008-06-19.18:00:57
SpamBayes Score 0.032326307
Marked as misclassified No
Message-id <1213898461.96.0.5212531569.issue3125@psf.upfronthosting.co.za>
In-reply-to
Content
> I am not sure to understand. Can you elaborate?
> How is memory management different between windows and unix?

Removing the "if win32" bits will not make shared ctypes objects
picklable on unix.  Even on windows there are only picklable in the
context of spawning a child process.

I do not want to encourage people to try to transfer objects which
wrap operating system resources between running processes using
pickling because it is error prone unless done very carefully: one
needs to find some way of "keeping the resource alive" until the
target process gets a chance to unpickle the data.  (The source
process must not close its handle to the resource until the target
process obtains its own handle, which may not happen for a long time.)

The simplest way to avoid such problems is to only share such
resources through inheritance.  I do add some pickling support to some
types on Windows, but only to emulate the behaviour that Unix gets for
free using fork().  (On Windows trying to transfer objects like locks
or shared ctypes objects over a pipe or queue will, by design, fail
with a RuntimeError)
History
Date User Action Args
2008-06-19 18:01:02roudkerksetspambayes_score: 0.0323263 -> 0.032326307
recipients: + roudkerk, theller, amaury.forgeotdarc, Rhamphoryncus, jnoller
2008-06-19 18:01:02roudkerksetspambayes_score: 0.0323263 -> 0.0323263
messageid: <1213898461.96.0.5212531569.issue3125@psf.upfronthosting.co.za>
2008-06-19 18:01:00roudkerklinkissue3125 messages
2008-06-19 18:00:58roudkerkcreate