From owner-freebsd-hackers Thu Oct 8 14:52:37 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA28195 for freebsd-hackers-outgoing; Thu, 8 Oct 1998 14:52:37 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA28166 for ; Thu, 8 Oct 1998 14:52:32 -0700 (PDT) (envelope-from peter.jeremy@auss2.alcatel.com.au) Received: by border.alcanet.com.au id <40331>; Fri, 9 Oct 1998 07:51:46 +1000 Date: Fri, 9 Oct 1998 07:52:11 +1000 From: Peter Jeremy Subject: rfork() and POSIX threads To: freebsd-hackers@FreeBSD.ORG Message-Id: <98Oct9.075146est.40331@border.alcanet.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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