In the wiki it says that in order to use the multiprocessing module, the worker processes must be created before wx.App instantiation. This seems rather inflexible. For instance, the user can not specify how many workers there should be.
For what it’s worth, I was not aware of these supposed limitations and have been distributing code which violates them for years now. As long as any interaction with the wx module and/or instantiated widgets is avoided in the child processes, there does not seem to be any problem with this. In practice I also need to use threading to handle process IO and post events to the GUI as needed, of course, but there’s nothing particularly fancy there.
In the wiki it says that in order to use the multiprocessing module, the worker processes must be created before wx.App instantiation. This seems rather inflexible. For instance, the user can not specify how many workers there should be.
In the wiki it says that in order to use the multiprocessing module,
the worker processes must be created before wx.App instantiation.
This seems rather inflexible. For instance, the user can not specify
how many workers there should be.
For what it's worth, I was not aware of these supposed limitations and
have been distributing code which violates them for years now. As long
as any interaction with the wx module and/or instantiated widgets is
avoided in the child processes, there does not seem to be any problem
with this.
Agreed. If you keep all the GUI interaction in the main GUI process it should not matter when the child processes are created.
I do sorta remember a conversation with regards to multiprocessing where I mentioned that the native UI code and a lot of wx is initialized when the wx.App object is created, so if you want to keep the handles and other resources dedicated to the GUI from being duplicated in the forked child processes then you could do that by creating the child processes before the app object. Perhaps the wiki page author read my statement as a "must" instead of a suggestion.
···
On Tue, May 28, 2013 at 8:33 AM, <snorble@hotmail.com > <mailto:snorble@hotmail.com>> wrote: