Hi all,
it seems that multiprocessing does not work alongside
wx.CallAfter() ? Has anyone else noticed that ?
python-wxgtk3.0:
Installiert: 3.0.2.0+dfsg-3
Installationskandidat: 3.0.2.0+dfsg-3
I am doing the following: The user selects an item on the
list, the event handler kicks of a multiprocessing.Process()
which does a fairly lengthy transformation (say, retrieving
metadata from a large file). Eventually, the processing is
done and a callback is invoked with the results. Said
callback has been passed in when creating the Process().
The callback is called just fine. Results are delivered.
However, the callback then proceeds to update a TextCtrl with
help of
wx.CallAfter(tctrl.SetValue, value)
(because we are coming from another thread so need to
switch over to the main, GUI, thread)
but neither that nor doing
tctr.SetValue(value)
directly (expected to fail) does actually update the tctrl.
The very same code updates the ctrl just fine when replacing
the multiprocessing.Process() with threading.Thread() which
(intentionally) has got the same API.
Now, technically the difference is that multiprocessing uses
"subprocesses" while threading uses "real threads".
Supposedly the former are preferable because of the GIL (?).
SO, really, the question is -- is it a known fact that
wx.CallAfter doesn't seem to work when invoked from a
subprocess rather than a thread ?
Thanks,
Karsten
···
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346