[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Threads
On Fri, 15 Apr 2005, Fred Burton wrote:
> I'm using threads... er.. I'm using a thread with pygame, and then a
> thread for background loading of various things. (But only the original
> thread talks to pygame and opengl)
i'm doing that too in networked systems - Pete did show me a while back
how to do non-blocking downloading without threading using select, which
even works on windows for socket connections (but not local files i think,
unlike on posix),
http://www.tol.oulu.fi/~antont/programming/singlethreaddownload.py
.. but still afaik urllib2.urlopen() can block if e.g. the connection is
laggy or something, so can't have that regularly in the same thread that
is moving graphics / playing video / .. so am still using threads. would
like to get rid of that tho, perhaps to have the networking in a separate
process, but controlling processes did not seem to be that well supported
on windows (forking, killing etc) when last looked at it (am hopefully
wrong)
~Toni