
threaded initialization stuff twisted.internet.main.py is not working for me on windows. I propose we put all threaded initialization into a method of twisted.internet.main and have it called from threadable.init() in one place. This would include: installWaker() delayeds.append(threadtask.theScheduler) how about internet.main.enableThreading() which would do the work that is currently in installWaker and set up the delayed scheduler? On my machine with that change and some minor changes to threading.init() I can run both threaded and non-threaded code on windows. -----Original Message----- From: twisted-python-admin@twistedmatrix.com [mailto:twisted-python-admin@twistedmatrix.com]On Behalf Of Sean Riley Sent: Tuesday, August 21, 2001 3:23 PM To: twisted-python@twistedmatrix.com Subject: [Twisted-Python] threading on windows? I am trying to get a threaded twisted server to run on windows (Windows2000 SP3) and having some issues. There is an assert in threadable.py in init(): def init(with_threads): global threaded, _to_be_synched, dispatcher, dispatch, Waiter, dispatchOS print "Threadable init", with_threads if threaded == with_threads: return assert threaded is None threaded = with_threads that always asserts whether I pass "-t" to twistd or not. It seems that requireInit() gets called before init() so the code: def requireInit(): global threaded if threaded is None: init(0) is always run to initialize the global "threaded" to zero. If i take out that "assert threaded in None" it seems to initialize correctly on the "second" time through. But, in internet.main the global "waker" is never initialized as installWaker() is never called. I think that is because threadable.threaded was initialized as 0 the "first" time through when it was called by requireInit() and the code: if threadable.threaded: installWaker() in internet.main.py skips the installWaker() call. Anyone else tried running a threaded server on windows? _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python