Hi all,

this is only slightly off topic. I know that there are alot of good programmer
types here, so here goes.

scenerio: program forks/execv's another task, then does a waitpid() to reap the
exit status.

sounds relatively straight forward.

with today's faster cpu's, and the fact that they can do alot more in a typical
"timeslice", combined w/ cheaper (and therefore larger) ram sizes (so that a
process being forked/esedv'ed might actually be in the disk cache), it is
actually quite possible for the forked/execv'd program to start and run to
completion _before_ the parent process issues the waitpid(). WHen that happens,
the waitpid() returns an ECHILD error, and the exit return status is lost.

So I guess my question is: what's the properway to spawn a task to ensure that
you will definately trap the exit status.

Experianced programmer here. just looking for some hints/suggestions.

thx, and rgds,

-Greg

----------------------------------
E-Mail: Gregory Hosler <[EMAIL PROTECTED]>
Date: 16-Apr-02
Time: 14:54:46

  If each of us have one object, and we exchange them,
     then each of us still has one object.
  If each of us have one idea,   and we exchange them,
     then each of us now has two ideas.

----------------------------------



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to