emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: delete-process bug


From: Michael Mauger
Subject: Re: delete-process bug
Date: Fri, 26 May 2006 17:27:36 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> 
> > Thanks for working on this.  I agree that `live_deleted_processes'
> > is a good name.  ("Zombie process" has a different meaning.)
> 
> > However, maybe there is still a race condition.  Suppose the signal
> > comes in the middle of the line
> 
> >     +      live_deleted_processes = Fcons (make_number (p->pid),
> >     +                                     /* GC previous elements.  */
> >     +                                     Fdelq (Qnil, 
live_deleted_processes));
> 
> > Suppose it comes between there and the call to remove_process?
> 
> I think it's OK: if the signal handler comes before the assignment to
> live_deleted_processes, then it'll all behave as if the signal came even
> before the call to delete-process.  If it comes afterwards, the signal will
> be ignored (as if it came after the call to delete-process).
> 
> > Does the right thing happen in all these cases?
> 
> I believe so.
> 

My instinct would be to add the pid to the list prior to causing the event that 
the list is designed to detect.  Treating the signal as though it happened 
before the call to delete-process (if we don't add the pid to the list first) 
when we know it was most likely caused by delete-process seems to be asking for 
trouble.

Just sayin'...





reply via email to

[Prev in Thread] Current Thread [Next in Thread]