CLONE_PPID does have a nice ring to it.
So far the kernel changes are so small that I'm just going to use this
as a test bed for enhancing LinuxThreads. Later I'll work out how
ambitious to be about extending to support fully POSIX threads.
Unexpected thread manager death is handled nicely by having each
thread call prctl() so that they get SIGKILLed when the manager thread
(their parent) dies.
> > The changes to the kernel are tiny, it fixes one problem nicely, and
> > doesn't seem to create any new ones.
> this is really cool. Have you measured the performance of pthread_create()
> before and after this change?
I've hacked support into the kernel, and written a non-LinuxThreads
test program to make sure CLONE_MINOR works properly. Measuring the
performance difference is my aim, but it is still a few days away ;-)
And right now I'm working out exactly how to rebuild
glibc-LinuxThreads on it's own...
> Another thing i noticed in LinuxThreads is
> is the 'manager pipe' communication overhead, is this still is present?
> Not sure how this could be avoided though :(
It might be possible. Of the four messages currently used:
- The "create a thread" message becomes unnecessary.
- The "thread exit" message becomes unnecessary because the manager
receives the child death signal.
- The "main thread exit" is handled because the manager thread _is_
the main thread.
- The "process exit" message remain, but it is probably possible to
use a signal for this.
Having the manager thread receive a child death signal each time a
thread exits is, although necessary in some cases, an unnecessary
overhead in others (since usually a thread will clean up after itself
and then call _exit()). I haven't though of a nice way to avoid this
-- Dave Wragg
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to email@example.com