From owner-freebsd-hackers Thu Jun 28 19:30: 1 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mta5.rcsntx.swbell.net (mta5.rcsntx.swbell.net [151.164.30.29]) by hub.freebsd.org (Postfix) with ESMTP id BD82A37B403; Thu, 28 Jun 2001 19:29:56 -0700 (PDT) (envelope-from chris@holly.calldei.com) Received: from holly.calldei.com ([208.191.149.190]) by mta5.rcsntx.swbell.net (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) with ESMTP id <0GFO00KIQ6SY0A@mta5.rcsntx.swbell.net>; Thu, 28 Jun 2001 21:26:59 -0500 (CDT) Received: (from chris@localhost) by holly.calldei.com (8.11.1/8.9.3) id f5T2TgL63943; Thu, 28 Jun 2001 21:29:43 -0500 (CDT envelope-from chris) Date: Thu, 28 Jun 2001 21:28:56 -0500 From: Chris Costello Subject: Re: libc_r locking... why? In-reply-to: ; from eddy+public+spam@noc.everquick.net on Fri, Jun 29, 2001 at 02:15:04AM +0000 To: "E.B. Dreger" Cc: freebsd-smp@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Reply-To: chris@calldei.com Message-id: <20010628212856.E55395@holly.calldei.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i References: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Friday, June 29, 2001, E.B. Dreger wrote: > Please pardon the cross-posting; I'd rather keep responses on whichever > list is more appropriate. > > Why are bind(2), accept(2), kevent(2), etc. wrapped in libc_r? Currently, the pthreads implementation is done entirely in userland. This means that a syscall which would normally block needs to have code in it to check if it would block (write(2) is a really simple example of this), and if it would, schedule another thread (cancelling, or blocking, the calling thread) to run, and eventually get back to the thread which is blocking on write, check for/read more data, cancel again, etc., until the requested amount of data has been read or an error occurs. This example, of course, applies to instances where write() is called on a file descriptor which does _NOT_ have O_NONBLOCK set. kevent(2), bind(2), accept(2) etc. all do the same thing for the same reasons. -- +-------------------+-----------------------------------------+ | Chris Costello | Advanced design: | | chris@calldei.com | Upper management doesn't understand it. | +-------------------+-----------------------------------------+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message