Under Windows you might have another kind of problem and end up with a leaked
process handle if you create a process with CreateProcess() and don't call CloseHandle() on the hThread and hProcess members of the returned PROCESS_INFORMATION struct.
On Thursday 10 April 2003 13:39, Randy Beckwith wrote:
Thanks, Caleb! I changed the code to not set the
process name and also set the options flag to inherit
the environment and everything worked fine.
I hate that when things don't work the same between
Linux and Windows.... :-( The orginal code worked
beautifully on Windows.
So I need to get the child process exit status to
avoid zombies.... Hmmm... more code just for Linux.
Sounds like i'm going to have to start up an extra
thread on Linux to just sit there and poll for exit
statuses. Not sure I like that but ....
Thanks again, Caleb.
Randy
--- Caleb Epstein <cae@bklyn.org> wrote:
On Thu, Apr 10, 2003 at 06:36:42AM -0700, Randy
Beckwith wrote:
My program is attempting to spawn 5 different
processes using
the Process_Manager interface. This works
perfectly > well on
Windows 2000 but on Linux (RedHat 8.0) I get 5
(zombied?) >
copies of the spawning program itself.
Zombie processes are an indication of spawning
processes
without "reaping" their exit status. You need to
call
ACE_Process_Manager::reap or ::wait to collect the
exit codes
of your children.
Note that if you are going to specify the
process_name, it
needs to be a real executable name that can be
exec()'ed, not
a symbolic string. Basically, it should match
argv[0] in your
command_line.
You might want too look at the
Process_Manager_Test.cpp test
code.
--
Caleb Epstein | bklyn . org | You can fool some of
the people all of the
cae at | Brooklyn Dust | time, and all of the
people some of the time,
bklyn dot org | Bunny Mfg. | but you can make a
fool of yourself anytime.
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more http://tax.yahoo.com
HiGuys,
--
Juan Jose Comellas
(juanjo@comellas.com.ar)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 42:36:13 |
Calls: | 6,648 |
Files: | 12,193 |
Messages: | 5,329,574 |