From owner-freebsd-threads@FreeBSD.ORG Tue Apr 22 01:18:17 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 00A2A37B401 for ; Tue, 22 Apr 2003 01:18:17 -0700 (PDT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6078243FAF for ; Tue, 22 Apr 2003 01:18:15 -0700 (PDT) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id h3M8IAmF080489; Tue, 22 Apr 2003 12:18:10 +0400 (MSD) Date: Tue, 22 Apr 2003 12:18:10 +0400 (MSD) From: Igor Sysoev X-Sender: is@is To: Daniel Eischen In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: libkse -> libpthread X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2003 08:18:17 -0000 On Mon, 21 Apr 2003, Daniel Eischen wrote: > On Mon, 21 Apr 2003, Terry Lambert wrote: > > > Jeff Roberson wrote: > > > On Mon, 21 Apr 2003, Daniel Eischen wrote: > > > > Since libkse seems to be generally useful, anyone mind if I > > > > go back to installing it as libpthread? > > > > > > There is some question over whether kse or thr will be the default > > > threading implementation for 5.1. I think this should be discussed before > > > we decide on what lib uses libpthread. > > > > Isn't libthr really just libkse with N = M? > > Yes, I wasn't going to bring that up, though. > > > These should behave exactly the same, right? It should even be > > possible to drop the UTS out of the picture for everything but > > signal handling, I think (i.e. it would never get upcalled) in > > the 1:1 case, if this were done? > > Libpthread can be made to behave the same as libthr just > by forcing every thread to be scope system. Currently, > the implementation for scope system threads does have > a small amount of overhead in that they still get upcalls > after the thread blocks in the kernel (in this case > the KSE just reenters the kernel with kse_release() > and waits for the thread to become unblocked). These > KSEs also require a small stack separate from the > thread's stack. The code is in place (in the UTS) to > not require a separate stack and not get any upcalls > for these threads, but we just need a bit more > kernel work to optimize this overhead away. But why is not it implemented via setting kse_mailbox.km_curthread to NULL ? As I understand it's way to disable upcalls when UTS is preempted by the kernel (the time slice ended, the page in operation, etc.) i.e. UTS should always run as 1:1 thread. Had it been changed ? How is UTS protected now ? Igor Sysoev http://sysoev.ru/en/