child-process

Is there a way to make sure a background process spawned by my program is killed when my process terminates?

Basically the child process runs indefinitely until killed in the background, and I want to clean it up when my program terminates for any reason, i.e. via the Taskmanager. Currently I have a while (Process.GetProcessesByName("ParentProcess").Count() > 0) loop and exit if the parent process isn't running, but it seems pretty brittle, a...

Can Visual Studio be made to debug child processes like WinDBG?

This is similar to this question, but I wanted to flesh it out a bit. (I'm new here, if I should instead do a "bump" answer on the previous question instead, please let me know.) In WinDBG, I can use the .childdbg 1 command to tell it to break when a child process is spawned, or I can launch it with the -o command-line option. This is...

Multiple child process

hi, can someone help me about how to create multiple child processes which have the same parent in order to do "some" part of particular job? for example, an external sorting algorithm which is applied with child processes; each child process sorts a part of data and finally the parent merges them.. EDIT: Maybe I should mention the f...

Multiple child process + reading from a stream

hi, referring to my last question (http://stackoverflow.com/questions/876605/multiple-child-process), i am now trying to make an external sorting implementation using multiple child process. ... fp = fopen(pathname, "r"); // open inputfile in r mode fgets(trash, 10, fp); // ignore first line for (i=0; i<numberOfProcess; ++i) { #ifdef...

How can I make Perl wait for child processes started in the background with system()?

I have some Perl code that executes a shell script for multiple parameters, to simplify, I'll just assume that I have code that looks like this: for $p (@a){ system("/path/to/file.sh $p&"); } I'd like to do some more things after that, but I can't find a way to wait for all the child processes to finish before continuing. Conver...

Problem with Process.Start() method.

I have a child.exe which takes command line arguments. I need to start that child.exe from another parent.exe application and need to pass different command line arguments to that child.exe. I tried with the following code. Process process = new Process(); process.StartInfo.FileName = @"R:\bin\child.exe"; process.StartIn...

How does one automatically attach a debugger to a process at process start on OS X?

I have a process that spawns a helper process. Sometimes I need to debug start-up failures in the second process. On Windows, I would use Image File Execution Options, or ntsd -o. However, I have no idea how to do this with gdb on OS X. ...

Child process stops when Thread.sleep() is called (in Java under Windows)

I have a Java application that launches an external process (Internet Explorer) using ProcessBuilder. Strangely enough, this child process freezes when the parent Java thread calls Thread.sleep. It does not happen with all processes, for instance Firefox, but with IE it happens all the time. Any ideas ? P.S. I tried Robot.delay() with...

Creating a child process on Unix systems?

I'm trying to create a child process in another process. I am writing both the programs in C language. First I write a dummy process which will be the child process. What it is doing is only to write a string on the screen. It works well on its own. Then I write another program which will be the parent process. However, I can't make it h...

Another benefit of having Lighttpd in front of Apache

I have read in a site that another benefit of having Lighttpd in front of Apache is lower number of child processes. Lighttpd will handle keep-alive and client requests while child processes of Apache gets to serve dynamic pages faster because of the very low latency communication between Lighttpd and Apache. I am trying to find the link...