This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: snapshot 20050114 race (on list)



Christopher Faylor wrote:

> >
> >I think there is no real need to distinguish between
> >PID_ZOMBIE and PID_EXITED.
> 
> Actually, there is.  I thought about this a lot.  I would like to get
> rid of both states but they are not identical.  The PID_ZOMBIE state
> is only valid for situations when the parent has not yet wait()ed for
> the child or for when the parent is ignoring SIGCHLD.  PID_EXIT just
> indicates that the child has exited and the parent, if one exists,
> hasn't gotten around to it yet.
> 
> While you could just set PID_ZOMBIE in every case, that would mean
> that ps would occasionally display a pid as a zombie that wasn't
> truly a zombie.  I couldn't convince myself that was a good thing.
> 
> I also don't see how there can be a race between setting PID_ZOMBIE and
> PID_EXITED.  PID_ZOMBIE is only set when a child has either already set
> PID_EXITED or the child has exited.

You are right, there is no race there. Sorry for the noise.
Most places in Cygwin (e.g. ps) don't seem distinguish between ZOMBIE and
EXITED, but fhandler_process does. Perhaps ps should too. 

Pierre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]