From owner-freebsd-arch Fri Dec 13 11:40:28 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 39F3537B401 for ; Fri, 13 Dec 2002 11:40:27 -0800 (PST) Received: from dibbler.ne.client2.attbi.com (dibbler.ne.client2.attbi.com [66.31.42.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55CB043EC2 for ; Fri, 13 Dec 2002 11:40:26 -0800 (PST) (envelope-from rodrigc@attbi.com) Received: from dibbler.ne.client2.attbi.com (localhost [127.0.0.1]) by dibbler.ne.client2.attbi.com (8.12.6/8.12.6) with ESMTP id gBDJf3db003945; Fri, 13 Dec 2002 14:41:03 -0500 (EST) (envelope-from rodrigc@dibbler.ne.client2.attbi.com) Received: (from rodrigc@localhost) by dibbler.ne.client2.attbi.com (8.12.6/8.12.6/Submit) id gBDJf30T003944; Fri, 13 Dec 2002 14:41:03 -0500 (EST) Date: Fri, 13 Dec 2002 14:41:03 -0500 From: Craig Rodrigues To: Nathan Arun Cc: arch@FreeBSD.ORG Subject: Re: Threads in FreeBSD Message-ID: <20021213144103.A3790@attbi.com> References: <20021213133306.U31761-100000@alpha.yumyumyum.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20021213133306.U31761-100000@alpha.yumyumyum.org>; from culverk@yumyumyum.org on Fri, Dec 13, 2002 at 01:35:28PM -0500 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Dec 13, 2002 at 01:35:28PM -0500, Kenneth Culver wrote: > > I'm currently reading the book "Modern Operating Systems" by Tanenbaum, > > where he says there are 2 kinds of threads. user-level and kernel-level. > > What type of threads is implemented in FreeBSD? user, kernel or both? > > FreeBSD-STABLE's threads are currently totally in userland. ....and the source code is in src/lib/libc_r/uthread > FreeBSD-CURRENT's threads will eventually be a sort of a hybrid design, > with kernel support for multiple threads so that different parts of the > kernel, and different userland threads can be run on different processors. > The FreeBSD implementation in -CURRENT is similar to the Scheduler > Activation method. The thread scheduler is in userland with an upcall into > the kernel that can cause threads to be scheduled across multiple > processors. I'm not sure that's quite working yet, but work is progressing > in -CURRENT, and from what I hear, should be ready in time for 5.1-RELEASE ...and you can read more about the status of Kernel Schedulable Entities in FreeBSD at: http://www.freebsd.org/kse/ Work is ongoing for that project. You can read the original Schedular Activations paper also: http://citeseer.nj.nec.com/anderson92scheduler.html I don't have any good references offhand for Win32 threads, since the original poster asked for Win32 threading information. You can try reading stuff from MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_multithreading_with_c_and_win32.asp Here is an article which mentions how to implement POSIX-style condition variables on Win32: http://www.cs.wustl.edu/~schmidt/win32-cv-1.html That may also give you an idea of some of the differences between pthreads and Win32 threads. -- Craig Rodrigues http://www.gis.net/~craigr rodrigc@attbi.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message