Re: Running programs in the background?



Michael Schlenker schrieb:
Volker Hetzer schrieb:
Hi!
On Windows (XP) I'd like to run two programs (cmd /c ...) in parallel
and then wait for both of them to complete.
How would I go about it?

Either use twapi to wait for some pid, or simply use the open | syntax
instead of exec and run those programs in pipes with fileevent.

The fileevent man page has an example:
http://wiki.tcl.tk/fileevent
So I open a pipe, process file events until I get an EOF,
increment some variable and vwait in a loop until that variable is 2?

Sounds good to me.

Thanks a lot!
Volker
--
For email replies, please substitute the obvious.
.



Relevant Pages

  • Re: Invoking external processes in threaded program
    ... some pipes. ... the child other than exec*() immediately. ... It waits on a unix socketpair() for commands from the multi- ... man child process through the unix socket and sendmsg as SCM_RIGHTS ...
    (comp.unix.programmer)
  • Re: Invoking external processes in threaded program
    ... some pipes. ... but the general advice with respect to forking in ... the child other than exec*() immediately. ...
    (comp.unix.programmer)
  • Communicate to subprocesses created by exec()
    ... I need to create a subprocess by exec() /vforkand call execin the child-process), because I want to execute a user-supplied binary file. ... It does not matter how, but I believe pipes are the best way for inter-process communication, right? ... My problem is just that I can't use pipeto open it, as the child-process inherits open file descriptors for fork, but it doesn't seem to be possible for exec, is it? ... So it looks to me as if the only possible way to reach data to the sub-process would be by passing arguments. ...
    (comp.unix.programmer)
  • Re: Invoking external processes in threaded program
    ... some pipes. ... the child other than exec*() immediately. ... The child is a single-threaded process so that it can fork and exec ...
    (comp.unix.programmer)
  • Re: Communicate to subprocesses created by exec()
    ... exec() in the child-process), because I want to execute a ... but I believe pipes are the best ... child-process inherits open file descriptors for fork, ... Named pipe or domain socket can be sufficient. ...
    (comp.unix.programmer)