lkml.org 
[lkml]   [2002]   [Aug]   [15]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 16 Aug 2002 04:09:02 +0100
FromJamie Lokier <>
SubjectRe: [patch] user-vm-unlock-2.5.31-A2
Ingo Molnar wrote:
> > [...] And I would like this while having the benefit of CLONE_DETACHED -
> > because I want to use this for high performance threading but still be
> > robust - so waitpid() is out.
> 
> like i said in the original email, the point of CLONE_DETACHED is to avoid
> the waitpid() overhead. I also said that exit notification is done via
> mutexes (futexes).

How?  Scenario:

   1. a thread calls a 3rd party library which was _not_ compiled with
      threading in mind.  (It shouldn't have to be).

   2. 3rd party library sends itself a SIGABRT; perhaps an assertion
      failed.  (Variants: SIGFPE, library does execve(), etc.)

   3. thread exits....   but the mutex was _not_ released
   4. I _want_ to report the death to other thread, without having
      to poll all my children in my main event loop.

This is a very legitimate and useful kind of thread death, and it's
perfectly safe too.  (Not pthreads-conformant, but clone() is useful for
more than just pthreads).

As things are at the moment, you've arranged things so that I can't use
CLONE_DETACHED if I want to catch threads which die unexpectedly.

Why can't I have both at the same time?  They are both good.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:22    [from the cache]
©2003-2008