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:                        |
| [EMAIL PROTECTED] | Upper management doesn't understand it. |
+-------------------+-----------------------------------------+

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

Reply via email to