2 Jul
2007
2 Jul
'07
6:14 a.m.
On Mon, 02 Jul 2007 11:04:56 +0200, Markus Schiltknecht <markus@bluegap.ch> wrote:
[snip] Anyway, with very simple timing measures within the twisted server itself, I've figured out what was causing the delays: reactor.spawnProcess() takes more than a second. I knew that fork() was expensive, but that expensive?
This isn't normal.
What I'm doing now feels very dirty: I'm calling reactor.spawnProcess() from a thread. (Yes, I'm taking care that only one thread can spawn a process at any time.) At least on my Linux Dev-Box, that seems to work - and resolves my issue. But... calling fork() from a thread???
Er. That's not supported. The only Twisted API you can call from a thread is reactor.callFromThread. Jean-Paul