Hi and thanks for the info. The initial plan was to have a thread listening on a socket, as I need the nox application to communicate with an external (python) application (while handling the controller's behaviour at the same time of course). But now it looks like the first option I should have considered for this purpose was to use twisted. While I don't know the lower-level specifics of twisted, I didn't think this would raise conflicts with existing internal nox events and the reactor, and some quick experimentation confirmed this. However I'm wondering if there are any pitfalls
On Mon, May 11, 2009 at 1:08 AM, Teemu Koponen <[email protected]> wrote: > On May 10, 2009, at 15:19 , kyriakos zarifis wrote: > > I was wondering if someone came up with an answer to this old thread: >> http://www.mail-archive.com/[email protected]/msg00068.html >> When I create a new python thread through the nox app, it seems like it >> initially runs for a really short period and then hangs - as if it only runs >> for the first timeslice allocated by the scheduler? - and the control >> remains on the main app thread from that point on. The controller functions >> as expected, e.g. it responds to events, but the child python thread looks >> dead/sleeping. >> Is there any reason why nox would affect the new thread in this case? >> > > Contrary to what the original thread suggests, I think Python has used > native threads for sometime instead of green threads. While I don't know > the details of Python threading C APIs, my understanding is that this comes > with certain responsibilities: a) special initialization procedures and b) > GIL (Global Interpreter Lock) management in C/C++ for any code entering > Python. If you don't properly take care of a) and b) (and NOX platform > doesn't), the side-effects could be anything, for instance something like > you describe. > > Moving forward, we have some plans to decouple Python and C++ into separate > processes to have support for Python threading. >
_______________________________________________ nox-dev mailing list [email protected] http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
