Date: Fri, 9 Oct 1998 07:52:11 +1000 From: Peter Jeremy <peter.jeremy@auss2.alcatel.com.au> To: freebsd-hackers@FreeBSD.ORG Subject: rfork() and POSIX threads Message-ID: <98Oct9.075146est.40331@border.alcanet.com.au>
next in thread | raw e-mail | index | archive | help
A few weeks ago, someone mentioned that it was difficult to implement POSIX threads in the kernel (using rfork) because POSIX requires each thread to have the same PID whereas rfork gives each thread a different PID. One potential solution came to me this morning (though I haven't looked at the ramifications in detail and it may be impractical): Add a new `thread group' (similar to a process group) to a process. Normally, fork() would make the thread group the same as the PID. A flag to rfork() would allow the child process to inherit the thread group (and probably parent pid) from its parent instead. If I understand POSIX correctly, signal semantics would need to be altered to send signals to the thread group, rather than a process id. Two new system calls would be required to allow a process (rather than a thread group) to be killed, as well as obtain the thread group. As a further naming change, `process ID' could be changed to `thread ID', allowing `thread group' to be renamed `process ID'. This may make the terminology clearer to multi-threaded processes outside the kernel. Any comments? Peter -- Peter Jeremy (VK2PJ) peter.jeremy@alcatel.com.au Alcatel Australia Limited 41 Mandible St Phone: +61 2 9690 5019 ALEXANDRIA NSW 2015 Fax: +61 2 9690 5247 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?98Oct9.075146est.40331>