Message271622
Queuing the class doesn't do anything here. It gets pickled as a module attribute; the queue isn't marshaling the class dict. For example:
>>> pickletools.dis(pickle.dumps(mccabe.McCabeChecker))
0: \x80 PROTO 3
2: c GLOBAL 'mccabe McCabeChecker'
24: q BINPUT 0
26: . STOP
highest protocol among opcodes = 2
Unpickling this is basically getattr(sys.modules['mccabe'], 'McCabeChecker'). So you'll see the same result if you only put ('max_complexity', 10) in the queue and hard code the class in the _target function.
Of course for a system that uses fork() the class attribute is the same in the child process. In 3.4+ you can force spawning by initially calling multiprocessing.set_start_method('spawn'). Then you'll see the same result as in Windows. |
|
Date |
User |
Action |
Args |
2016-07-29 13:51:42 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower, icordasc |
2016-07-29 13:51:42 | eryksun | set | messageid: <1469800302.41.0.2413935932.issue27649@psf.upfronthosting.co.za> |
2016-07-29 13:51:42 | eryksun | link | issue27649 messages |
2016-07-29 13:51:42 | eryksun | create | |
|