Email List: Xaustin-group-lX
[All Lists]

Re: [Fwd: Re: whether ext() and atexit() are safe w.r.t each other

To: David Butenhof <david.butenhof@xxxxxx>
Subject: Re: [Fwd: Re: whether ext() and atexit() are safe w.r.t each other
From: Anoop <acv@xxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Jun 2008 12:58:05 +0530
Cc: Geoff Clare <gwc@xxxxxxxxxxxxx>, "austin-group-l@xxxxxxxxxxxxx" <austin-group-l@xxxxxxxxxxxxx>
References: <1212759114.12557.52.camel@localhost.localdomain> <20080606154514.GB39160@finch-staff-1.thus.net> <48496905.2050606@hp.com> <20080609075139.GC74480@finch-staff-1.thus.net> <20080609085814.GA23187@squonk.masqnet> <484CFFA2.6000701@hp.com>
David Butenhof wrote:
The list could be managed, for example, as a simple lock-free list. An atexit handler registered asynchronously from another thread during exit() processing MAY or MAY NOT be called by the thread executing exit() depending on the implementation strategies.

But wont this implementation (without synchronization) cause inconsistencies in the list,
which might result in, handlers already registered (even before exit was called),
not to be invoked, which is a violation of the standard?
I guess the implementation needs to ensure (by locking or any other better means) that,
All successfully registered handlers are invoked before exiting, or in other words,
Fail all the registrations that cannot be handled. Is that correct?

- Anoop

<Prev in Thread] Current Thread [Next in Thread>