From owner-freebsd-hackers@FreeBSD.ORG Fri May 23 23:42:10 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4D61337B401 for ; Fri, 23 May 2003 23:42:10 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B77F43FA3 for ; Fri, 23 May 2003 23:42:09 -0700 (PDT) (envelope-from eischen@pcnet1.pcnet.com) Received: from pcnet1.pcnet.com (localhost [127.0.0.1]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h4O6fxwQ016966; Sat, 24 May 2003 02:41:59 -0400 (EDT) Received: from localhost (eischen@localhost)h4O6fww6016963; Sat, 24 May 2003 02:41:58 -0400 (EDT) Date: Sat, 24 May 2003 02:41:58 -0400 (EDT) From: Daniel Eischen To: Valentin Nechayev In-Reply-To: <20030524061631.GA3167@iv.nn.kiev.ua> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: Dan Nelson cc: Julian Elischer Subject: Re: libkse and SMP (was Re: USB bulk read & pthreads) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2003 06:42:10 -0000 On Sat, 24 May 2003, Valentin Nechayev wrote: > DE> I'm not sure if what you meant here, but here's a (hopefully) > DE> clearer explanation. > > DE> All threads that are created with PTHREAD_SCOPE_PROCESS > DE> (the default) will run in the same (initial) KSEG. The > DE> initial KSEG will have as many KSEs as CPUs by default. > DE> When a scope process thread blocks in the kernel, upcalls > DE> are made to the originating KSE and a new thread is scheduled. > DE> When scope process threads unblock in the kernel, upcalls ^^^^^^^ plural > DE> are made to one or more of the same KSEs within the initial > DE> KSEG to notify the library that the threads can be resumed. > > DE> Each scope system thread gets its own KSE/KSEG pair in which > DE> to run. > > Sorry, I again lost understanding of this ;(( > Consider system with single CPU and 2 threads (with process scope) which > both calls blocking disk read. Can the second thread block in read() > before first thread returns from blocking read()? Or system scope > is required for this? Multiple scope process threads can be blocked in the kernel at the same time. This does not prevent other scope process threads from being run. -- Dan Eischen