Re: Parallelling system_exec
- Posted by Andy Serpa <ac at onehorseshy.com> Jun 28, 2004
- 417 views
Patrick Barnes wrote: > > Wait.... > > I'm writing a script that just has to call an executeable roughly 20 > times. All I want is for the code to return immediately from the > system call, not wait for the executeable to finish (most of the time > is on the server). > > There are no gui elements to this script at all... I don't want to be > shackled to a gui library. > The code I provided does just that -- allows you to run a program without waiting on a return value. No GUI is needed, but it does use the Windows API and Bernie's windows engine. To run something several times without any interaction, just do:
handle = child_process("program.exe") child_close(handle) handle = child_process("program.exe") child_close(handle) handle = child_process("program.exe") child_close(handle) handle = child_process("program.exe") child_close(handle)
All 4 instances will start up nearly simulataneously, and the calling program can go ahead and exit if desired...