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
[EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to