Process forking on Windows

Gary Herron gherron at islandtraining.com
Wed May 17 19:05:48 CEST 2006


Andrew Robert wrote:

>bruno at modulix wrote:
>  
>
>>Andrew Robert wrote:
>>    
>>
>>>Hi everyone,
>>>
>>>
>>>I have a python program that will need to interact with an MQSeries
>>>trigger monitor.
>>>
>>>It does this fine but it hogs the trigger monitor while it executes.
>>>
>>>I'd like to fork the program off and terminate the parent process so
>>>that the trigger monitor frees up.
>>>      
>>>
>><just-asking>
>>Is this really the solution ?
>></just-asking>
>>
>>    
>>
>>>Does anyone how this can be accomplished on a Windows platform?
>>>      
>>>
>>AFAIK, there's no fork in Windows - you might want to give a try with
>>CreateProcess.
>>http://www.byte.com/art/9410/sec14/art3.htm
>>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnucmg/html/UCMGch01.asp
>>
>>HTH
>>    
>>
>
>
>Unfortunately there is a real need for this.
>
>The MQSeries trigger monitor is single threaded.
>
>Because of this, my program would absorb it until it completes.
>
>The way to get around this would be to fork off and terminate the parent.
>
>Unfortunately, Windows appears to be somewhat stubborn about it.
>
>Creating a subprocess does not alleviate the need to get the originating
>process out of the trigger monitor.
>  
>

The windows CreateProcess call has many of the same semantics as the 
Unix fork, i.e., a new process is created sharing all the resources of 
the original process.  The "subprocess" modules uses CreateProcess, but 
if that does not give you sufficient control over the process creation, 
you can call CreateProcess directly via the "win32process" module in the 
win32all package.

However, I still don't understand *what* the "MQSeries trigger monitor" 
is or *how* it would create the need for such a solution.

Gary Herron





More information about the Python-list mailing list