[Bf-committers] Re: listener object (Martin DeMello)

Toni Alatalo antont at kyperjokki.fi
Wed May 11 15:08:53 CEST 2005


> From: Martin DeMello <martindemello at gmail.com>
> Scripts will run in their own threads, yes, but don't they do that
> anyway? I was essentially hoping that the scriptlink mechanism already

no, i think they do not do that, but are triggered by Blender in the event 
driven fashion. i just verified that by putting linking time.sleep(10) to 
frame change, which makes the use very annoying ;p (a good hint for anyone 
who thinks Blender is too fast!)

and using select(), which works on windows too for sockets (but not for 
reading files like on posix), the networking does not demand threading 
either - you can just use it to see if there is incoming data, and read as 
much as is considered sane during one run, process it, and return control 
back to Blender. for example, 
http://www.tol.oulu.fi/~antont/programming/singlethreaddownload.py 
reads a file from the web 1024 bytes at a time to not block e.g. a game 
that'd be running in the same (only) thread.

> martin

~Toni



More information about the Bf-committers mailing list