On Monday, April 24, 2000, Brian O'Shea wrote:
> On Mon, Apr 24, 2000 at 06:13:53AM -0400, Daniel Eischen wrote:
> > On Mon, 24 Apr 2000, Brian O'Shea wrote:
> > > 
> > > I was under the impression that, because user thread scheduling is done
> > > in user mode, a thread that goes to sleep calling a blocking read()
> > > system call will put the entire process to sleep until that read()
> > > returns (and so all user threads in the process will also be blocked).
> > > Is this correct?
> > 
> > 1. You are mistaken.
> 
> Could you elaborate?  The text that I am using [1] warns about blocking
> system calls putting the process (and thus all user threads) to sleep.
> This book has no FreeBSD specific information, so anything specific to
> FreeBSD would be really interesting to hear.

   FreeBSD's threads implement has its own read() function which
will make a non-blocking read() call (using the _real_ syscall)
for the specified amount of bytes.  Now a non-blocking read()
call fails unless all the data in nbytes can be read into buf.
So our implementation will continue to do a non-blocking read
until all the data can be copied and then allows the thread
continue, thus blocking only the calling thread.

   At least that's what the source code tells me.

-- 
|Chris Costello <[EMAIL PROTECTED]>
|I smell a wumpus.
`----------------------------------


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

Reply via email to