Python and Sockets,

John J Breen jbreen at
Thu Aug 1 21:05:41 CEST 2002

> do you have a thread that consumes all the CPU cycles? e.g. if you read
> from sockets, you should use blocking IO to avoid processing empty strings
> all the time.
> (you could temporary place a print statement in all your loops in the
> threads, to find out which one is running all the time.)

I have tried threads without sockets and I got the slowness I described
earlier. What I initially tried to do was run gtk in one thread and tk in
another. Threading works in the same process I believe so that would solve
the component communication on its own without needing sockets.
If the threading was speedier I dont think I would need sockets at all. I am
resorting to sockets because the threading doesnt seem to be working
coorectly or is just too slow.


More information about the Python-list mailing list