Message102172
| Author |
cool-RR |
| Recipients |
cool-RR |
| Date |
2010年04月02日.15:06:44 |
| SpamBayes Score |
2.5658782e-09 |
| Marked as misclassified |
No |
| Message-id |
<1270220809.31.0.384012166997.issue8289@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Currently, when you create a Process, all arguments you pass to its __init__ get pickled. I understood this is done because arguments to __init__ almost always become attributes to the Process. Like this:
def MyProcess(multiprocessing.Process):
def __init__(self, whatever):
self.whatever = whatever
Of course, attributes must be pickled so they can be accessed from the separate process (on Windows). And indeed in most cases all arguments to __init__ become attributes, so this makes sense.
But, in some cases you pass in arguments to __init__ that do not become attributes. In my case, __init__ takes an object, and takes some attributes of this object as attributes to itself. The object is unpicklable, but the attributes are. So I had to make some ugly workaround to make the program run.
So I think it would be better if Process would be smart enough to pickle only the arguments that get set as attributes. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年04月02日 15:06:49 | cool-RR | set | recipients:
+ cool-RR |
| 2010年04月02日 15:06:49 | cool-RR | set | messageid: <1270220809.31.0.384012166997.issue8289@psf.upfronthosting.co.za> |
| 2010年04月02日 15:06:46 | cool-RR | link | issue8289 messages |
| 2010年04月02日 15:06:44 | cool-RR | create |
|