DragonFly BSD
DragonFly kernel List (threaded) for 2005-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

libthread_xu pthread_exit() behaviour

From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Thu, 22 Sep 2005 19:05:16 +0200


at the moment I'm looking at the threading stuff and I found some issues:

If the main() thread pthread_exit()s, the "process" visible to the parent will exit. This is because the kernel doesn't have the notion of "threads" and "processes": The pid of the "process" goes away and thus all other threads become background processes (threads).

I am not sure where this is handled best. Maybe in kernel when dealing with p->p_peers (see next point):

If the main() thread exit()s, it won't tear down all other threads. This is an easy fix: just use RFTHREAD in the rfork_thread() and this works as expected. On the other hand if the main thread pthread_exit()s (see above) it will kill all other threads as well.

If we want the kernel to keep thread leaders around (sleeping?) until all peers have been pthread_exit()ed, we need a way for the userland to signal to the kernel that the thread is actually pthread_exit()ing and not trying to tear down all threads with exit() [new syscall?]

Am I missing something? Comments welcome!


Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low $$$ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \

Attachment: PGP.sig
Description: This is a digitally signed message part

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]