From owner-freebsd-questions Mon Nov 27 14:10:43 2000 Delivered-To: freebsd-questions@freebsd.org Received: from auchroisk.pdl.cs.cmu.edu (AUCHROISK.PDL.CS.CMU.EDU [128.2.189.63]) by hub.freebsd.org (Postfix) with ESMTP id 3116937B4C5; Mon, 27 Nov 2000 14:10:37 -0800 (PST) Received: (from dpetrou@localhost) by auchroisk.pdl.cs.cmu.edu (8.9.3/8.9.3) id RAA00845; Mon, 27 Nov 2000 17:10:31 -0500 (EST) Date: Mon, 27 Nov 2000 17:10:31 -0500 From: David Petrou To: freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org Subject: thread model questions Message-ID: <20001127171031.D417@auchroisk.pdl.cs.cmu.edu> Reply-To: dpetrou@cs.cmu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0us X-Hit-Pick: Rush / Exit ... Stage Left Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi. i've searched the handbook, tutorial, FAQ, and parts of the mailing list archives but haven't found direct answers to the following questions. i hope you don't mind answering them for me; it will save me a lot of time looking through the code, and / or writing test cases: let's say i'm running 4.x-stable. 1. if i use the pthreads interface, is each thread a process that happens to share the same addr space (like linux), or are all the threads part of the same single process (same PID)? 2. is the threading preemptive? or do i have to explicitly yield? 3. if preemptive, does that occur at user-level, or by the kernel? (and how costly is it?) 4. if one thread makes a system call that could block for some time, will another thread be automatically chosen? or will the whole collection of threads sleep until the call returns? 5. if i signal a particular thread, is the signal delivered to one thread or to all the threads in the process? 6. if a thread or process (terminology sucks) enters the kernel, can the scheduler preempt it and select another thread / process to run? (q.v., what many people call having kernel threads.) or will that process / thread dominate the system until it voluntarily relinquishes the processor? 7. are there other threads interfaces besides pthreads that i should be aware of? what are the differences? e.g., assuming freebsd supports a clone()-like interface, do some threads packages use it while others do as much as they can without kernel support? i'm probably forgetting some questions, but these are the bulk. i'm just wondering what the current thread model is as i contemplate moving my development to FreeBSD. thanks, david p.s.: please include me in any responses as i'm not subscribed to FreeBSD lists at the moment. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message