Date: Mon, 24 Apr 2000 20:29:54 -0700 From: "Brian O'Shea" <boshea@ricochet.net> To: Chris Costello <chris@calldei.com> Cc: "Brian O'Shea" <boshea@ricochet.net>, freebsd-hackers@FreeBSD.ORG Subject: Re: Multithreaded server performance Message-ID: <20000424202954.Z337@beastie.localdomain> In-Reply-To: <20000424215849.B14783@holly.calldei.com>; from Chris Costello on Mon, Apr 24, 2000 at 09:58:49PM -0500 References: <20000424010315.U337@beastie.localdomain> <Pine.SUN.3.91.1000424061006.7393A-100000@pcnet1.pcnet.com> <20000424141957.W337@beastie.localdomain> <20000424170700.A14783@holly.calldei.com> <20000424200351.Y337@beastie.localdomain> <20000424215849.B14783@holly.calldei.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000424202954.Z337>
