From owner-cvs-src@FreeBSD.ORG Tue Apr 1 00:04:35 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 93AA537B409; Tue, 1 Apr 2003 00:04:35 -0800 (PST) Received: from mail.nsu.ru (mx.nsu.ru [193.124.215.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id 54A20440E1; Tue, 1 Apr 2003 00:04:18 -0800 (PST) (envelope-from danfe@regency.nsu.ru) Received: from drweb by mail.nsu.ru with drweb-scanned (Exim 3.20 #1) id 190Gjs-0002zR-00; Tue, 01 Apr 2003 15:03:24 +0700 Received: from regency.nsu.ru ([193.124.210.26]) by mail.nsu.ru with esmtp (Exim 3.20 #1) id 190Gjh-0002rJ-00; Tue, 01 Apr 2003 15:03:13 +0700 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.12.8/8.12.8) with ESMTP id h3182u1Q056941; Tue, 1 Apr 2003 15:02:56 +0700 (NOVST) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.12.8/8.12.8/Submit) id h3182qVV056940; Tue, 1 Apr 2003 15:02:52 +0700 (NOVST) Date: Tue, 1 Apr 2003 15:02:52 +0700 From: Alexey Dokuchaev To: Julian Elischer Message-ID: <20030401080252.GA56851@regency.nsu.ru> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Envelope-To: julian@elischer.org, nate@root.org, cvs-src@freebsd.org, jeff@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org cc: cvs-src@freebsd.org cc: Jeff Roberson cc: src-committers@freebsd.org cc: cvs-all@freebsd.org cc: Nate Lawson Subject: Re: cvs commit: src/sys/kern kern_umtx.c src/sys/sys umtx.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2003 08:04:38 -0000 On Mon, Mar 31, 2003 at 05:38:13PM -0800, Julian Elischer wrote: > > On Mon, 31 Mar 2003, Nate Lawson wrote: > > > On Mon, 31 Mar 2003, Jeff Roberson wrote: > > > Added files: > > > sys/kern kern_umtx.c > > > sys/sys umtx.h > > > Log: > > > - Add an api for doing smp safe locks in userland. > > > - umtx_lock() is defined as an inline in umtx.h. It tries to do an > > > uncontested acquire of a lock which falls back to the _umtx_lock() > > > system-call if that fails. > > > - umtx_unlock() is also an inline which falls back to _umtx_unlock() if the > > > uncontested unlock fails. > > > - Locks are keyed off of the thr_id_t of the currently running thread which > > > is currently just the pointer to the 'struct thread' in kernel. > > > - _umtx_lock() uses the proc pointer to synchronize access to blocked thread > > > queues which are stored in the first blocked thread. > > > > > > Revision Changes Path > > > 1.1 +303 -0 src/sys/kern/kern_umtx.c (new) > > > 1.1 +87 -0 src/sys/sys/umtx.h (new) > > > > It's great to be getting this. Can you point me to a document indicating > > how this will be used by KSE? Are we going to have "native threads" > > (thr), KSE, and pthreads? > > We will have 3 threads schemes.. > userland threads > thr threads.. Useable by the majority of threaded apps > KSE threads.. Useable by threaded apps that have thousands of threads > > (i.e. KSE is a hybrid if userland and thr threads..) Does this follow from your words that creating of "thousands of threads" is better to be done in userland, versus kernel? Because of M:N model KSE will eventually utilize? Pardon my unawareness; pointing me to some document explaining all of this will also be appreciated. ./danfe