1. Spawning a process without waiting for a return
- Posted by alanjohnoxley Mar 01, 2011
- 1570 views
Hello, is it possible to use the Euphoria task handling to spawn other processes, without the main Euphoria program waiting for those processes? The spawned processes should have seperate process id's as if they were seperate programs. In fact the spawned processes may still be executing while the main Euphoria program is complete. I need to do this in the Windows 7 and XP environments, to test some wacky customer batch sheduling system that does this ;)
Both system() and system_exec() wait for the invoked process to finish. Even specifying system("call program_name") waits. I found a solution in the archive that uses dos interrupts, but thats obsolete :(
Any suggestions, even if it is not done through Euphoria tasks? TIA
2. Re: Spawning a process without waiting for a return
- Posted by mattlewis (admin) Mar 01, 2011
- 1612 views
Hello, is it possible to use the Euphoria task handling to spawn other processes, without the main Euphoria program waiting for those processes? The spawned processes should have seperate process id's as if they were seperate programs. In fact the spawned processes may still be executing while the main Euphoria program is complete. I need to do this in the Windows 7 and XP environments, to test some wacky customer batch sheduling system that does this ;)
Both system() and system_exec() wait for the invoked process to finish. Even specifying system("call program_name") waits. I found a solution in the archive that uses dos interrupts, but thats obsolete :(
Any suggestions, even if it is not done through Euphoria tasks?
Win32Lib wraps shellExecute and shellExecuteEx. Pete Lomax had wrapped that as well (or updated some code from Juergen Luethje), but the link in the archive is broken. I'd guess that Arwen wraps it as well. wxEuphoria has its own wrapper, too.
Matt
3. Re: Spawning a process without waiting for a return
- Posted by alanjohnoxley Mar 01, 2011
- 1571 views
Thanks Matt! I will see what I can find in those, beginning with Win32lib.
4. Re: Spawning a process without waiting for a return
- Posted by alanjohnoxley Mar 01, 2011
- 1553 views
Matt, you are a star! The shellExecuteEx did the job, working as designed :)
5. Re: Spawning a process without waiting for a return
- Posted by petelomax Mar 01, 2011
- 1537 views
Pete Lomax had wrapped that as well (or updated some code from Juergen Luethje), but the link in the archive is broken.
In case anyone wants that code, it is available as part of Edita and/or Phix (syswait.ew)
Pete
6. Re: Spawning a process without waiting for a return
- Posted by alanjohnoxley Mar 01, 2011
- 1520 views
FWIW, I tried to upload my code of about 2 pages delimited by the Creole euphoria formatting options, but it can't get past the preview. Anybody interested in my code, let me know and I will send it.
Thanks!
7. Re: Spawning a process without waiting for a return
- Posted by ne1uno Mar 02, 2011
- 1417 views
FWIW, I tried to upload my code of about 2 pages delimited by the Creole euphoria formatting options, but it can't get past the preview. Anybody interested in my code, let me know and I will send it.
a better way for code of more than a page is pasty on openeuphoria
the preview must be broken if it silently fails. maybe it's an anti spam measure.