[lkml]   [1998]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Thread implementations...
David Wragg writes:
> (Alan Cox) writes:
> > > Both of these problem could be neatly solved if the kernel
> > > knew that thread-like processes live in teams. There are other
> >
> > Sort of a thread group like process group model. You need to do that
> > cleanly however to keep it fast and Linus happy.
> Last night I added a small amount of kernel support, so that I can
> modify LinuxThreads for direct thread creation and find out what the
> improvements to pthread_create might actually be.
> A CLONE_MINOR flag to clone creates a /minor process/. When a minor
> process clones/forks a new process, the parent of the new process is
> the parent of the minor process, rather than the minor process
> itself. So by using CLONE_MINOR, all the threads become child
> processes of the initial process.
> So for LinuxThreads using CLONE_MINOR, the initial process becomes the
> manager thread. Whenever a threads exits (by any means), the manager
> (as the parent) gets the child death signal. Hence it can accurately
> keep track of all live threads.
> The changes to the kernel are tiny, it fixes one problem nicely, and
> doesn't seem to create any new ones.

I like this solution. It's really simple and elegant. It takes care of
the dying thread problem. Now all you need to do is make use of
prctl(2) and you can solve the dying main thread problem.



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to

 \ /
  Last update: 2005-03-22 13:43    [W:0.077 / U:5.344 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site