TKinter and multiprocessing in GNU/Linux/X

W

Weeble

I'm using the multiprocessing module in Python 2.6 to run a pygame
application. When errors occur, I create a new Process with the
multiprocessing module and have it display a TKinter dialog. The
pygame application can carry on happily without waiting for the
dialog. This works fine on Windows. However, I've just tried the same
code on Linux, and the TKinter dialog never appears. The process is
spawned - if I print from it then it still appears on the console, but
it does not display any TKinter window. If I create a TKinter window
in my main process it works okay.

I have a feeling that on Linux the multiprocessing module is doing a
fork and all of the subprocesses end up fighting over the same
connection to the X-server, is this possible? If so, is there some way
to get multiprocessing to create a more "independent" process like on
Windows? Or is there some way to tell TKinter to create a new
connection to the X-server?

I posted this as a question on Stack Overflow already, and there I've
included source code to demonstrate what I'm doing:
http://stackoverflow.com/questions/...ws-appear-when-using-multiprocessing-on-linux
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top