Re: [Pyobjc-dev] parallel processing
Brought to you by:
ronaldoussoren
|
From: Ronald O. <ron...@ma...> - 2009-03-28 20:25:38
|
On 28 Mar, 2009, at 13:43, Daniel Ashbrook wrote: > What's the recommended way to do parallel processing under PyObjc? I > assume that NSThreads are bound by the same GIL limitation that > prevents parallel processing under standard python. > > I've been trying the processing/multiprocessing (depending on the > verision) and almost have had good success; however, sometimes one or > two of the processes will hang on trying to callback the function, > presumably due to some weird interaction between the bridge and > fork()ed processes. > > What else should I try? As you noticed NSThreads are bound by the GIL, just as regular Python threads (as long as you try to run Python code obviously). I haven't tried using the multiprocessing library yet, I'd consider hanging processes a bug in either PyObjC or multiprocessing until proven otherwise. I know there are issues when using the fork system call without exec in a process using Apple frameworks, that's a limitation in those frameworks and not caused by Python/PyObjC. One option you could try is to spawn of a background program that does the actual calculation and have that use multiprocessing to make use of multiple processes. I have a note for the archives: don't use pyprocessing, it's basicly dead at the moment (at least according to Jesse Noller, who wrote multiprocessing). W.r.t. hanging processes: can you reproduce that in a standalone program? I'm at Pycon at the moment and might be able to get access to Jesse Noller to help research the issue. Ronald > > Thanks, > > > dan > > ------------------------------------------------------------------------------ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |