[Twisted-Python] What is the "Twisted" way to kill stuck child process

Jp Calderone exarkun at intarweb.us
Thu Feb 12 11:50:39 EST 2004

On Thu, Feb 12, 2004 at 11:03:52AM -0500, Schneider, Michael wrote:
> Again, I could be taking the wrong approach:
> Here is the scenerao:
> 1) Why the pooling
> Each compute node can run 2 processes at the same time (big processes)
> The compute node must accept more jobs then it can run, and hold the
> waiting tasks in a queue.  (logically similar problem to database
> connections, except, compute connections are used instead).
> 2) why not spawnProcess
> The code said that spawnprocess is broken on windows. (I could be
> looking
> in the wrong place, twisted is a big codebase :-)
> I fell back to using popen2 in a thead managed by the "thread pool"
> I am always open to refactoring a design.  Windows is my prime platform,
> but I also must support the UNIX platforms.
> Hope this helps clairify what I am doing (not saying that I am taking
> the correct approach with twisted, but I am trying and willing to change
> to do it the twisted way :-)

  I'm not certain of the status of spawnProcess on Windows.  If it really
doesn't work, I suppose popen2 is about all you can do.

  Since you're mainly developing on Windows, I doubt I can offer much more
assistance, having never written any multiprocess Windows apps.

  If popen2 lets you get PIDs on Windows, and os.kill() works with those
PIDs on Windows, I think you should still be able to timeout processes
fairly easily.  If they don't, maybe someone with more Windows experience
can chime in.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20040212/32c3d9d3/attachment.pgp 

More information about the Twisted-Python mailing list