From owner-freebsd-hackers Mon Apr 24 20:20:37 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.rdc1.sfba.home.com (ha1.rdc1.sfba.home.com [24.0.0.66]) by hub.freebsd.org (Postfix) with ESMTP id 10C1837C00B for ; Mon, 24 Apr 2000 20:20:32 -0700 (PDT) (envelope-from boshea@ricochet.net) Received: from beastie.localdomain ([24.19.158.41]) by mail.rdc1.sfba.home.com (InterMail v4.01.01.00 201-229-111) with ESMTP id <20000425032022.IRXD12856.mail.rdc1.sfba.home.com@beastie.localdomain>; Mon, 24 Apr 2000 20:20:22 -0700 Received: (from brian@localhost) by beastie.localdomain (8.9.3/8.8.7) id UAA23805; Mon, 24 Apr 2000 20:29:54 -0700 (PDT) (envelope-from brian) Date: Mon, 24 Apr 2000 20:29:54 -0700 From: "Brian O'Shea" To: Chris Costello Cc: "Brian O'Shea" , freebsd-hackers@FreeBSD.ORG Subject: Re: Multithreaded server performance Message-ID: <20000424202954.Z337@beastie.localdomain> Reply-To: boshea@ricochet.net Mail-Followup-To: Chris Costello , Brian O'Shea , freebsd-hackers@FreeBSD.ORG References: <20000424010315.U337@beastie.localdomain> <20000424141957.W337@beastie.localdomain> <20000424170700.A14783@holly.calldei.com> <20000424200351.Y337@beastie.localdomain> <20000424215849.B14783@holly.calldei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <20000424215849.B14783@holly.calldei.com>; from Chris Costello on Mon, Apr 24, 2000 at 09:58:49PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Apr 24, 2000 at 09:58:49PM -0500, Chris Costello wrote: > On Monday, April 24, 2000, Brian O'Shea wrote: > > Yea, I took a look at lib/libc_r/uthread/uthread_read.c too, but it > > didn't paint the whole picture for me. Specifically, I couldn't find > > the definition for the _thread_sys_read() function. It looks like the > > polling magic to which Jason Evans referred occurs in some interesting > > code in uthread_kern.c, though. > > _thread_sys_read() is the real read(2) syscall. They're > renamed to ``_thread_sys_SYSCALL()'' for the purpose of > reimplementing them in a thread-friendly manner, as you see with > read() there. > Well that explains it, then! There is actually a note about this in the read(2) man page which was confusing me before, but now I understand what it is talking about: IMPLEMENTATION NOTES In the non-threaded library read() is implemented as the read syscall. In the threaded library, the read syscall is assembled to _thread_sys_read() and read() is implemented as a function which locks d for read, then calls _thread_sys_read(). If the call to _thread_sys_read() would block, a context switch is performed. Before re- turning, read() unlocks d. Thanks, -brian -- Brian O'Shea boshea@ricochet.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message