ioslave terminating mechanism

Waldo Bastian bastian at kde.org
Thu Apr 18 00:52:23 BST 2002


On Wednesday 17 April 2002 04:53 pm, aleXXX wrote:
> On Thursday 18 April 2002 01:08, Waldo Bastian wrote:
> > That's nice and all but it fails to take into account that signal
> > delivery is asynchronous and the current code can deadlock when the
> > siganl happens to arrive at an inconvenient time. E.g. within a malloc or
> > free call. When you then call the destructor your process will deadlock.
> >
> > You simply can't call arbitrary code (the destructor of a slave) at any
> > arbitrary moment (when the signal arrives) and expect it to work.
>
> Ok, so how about setting a flag in the signal handler which is checked in
> dispatchLoop() and if it is set call the dtor from there ?

That sounds like a much better approach, although you will have to think of 
ways to make a slave exit which happens to be stuck on a DNS lookup or 
something.

Cheers,
Waldo
-- 
bastian at kde.org  |   SuSE Labs KDE Developer  |  bastian at suse.com





More information about the kde-core-devel mailing list