From owner-freebsd-hackers Thu Oct 19 19:15:56 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id TAA10624 for hackers-outgoing; Thu, 19 Oct 1995 19:15:56 -0700 Received: from werple.net.au (werple.mira.net.au [203.9.190.18]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id TAA10613 for ; Thu, 19 Oct 1995 19:15:45 -0700 Received: from cimaxp1.UUCP (Ucimlogi@localhost) by werple.net.au (8.7/8.7) with UUCP id MAA11995 for hackers@freebsd.org; Fri, 20 Oct 1995 12:08:27 +1000 (EST) Message-Id: <199510200208.MAA11995@werple.net.au> X-Authentication-Warning: werple.net.au: Ucimlogi set sender to cimaxp1!jb using -f Received: by cimaxp1.cimlogic.com.au; (5.65/1.1.8.2/10Sep95-0953AM) id AA16908; Fri, 20 Oct 1995 12:11:07 +1000 From: John Birrell Subject: Re: NetBSD/FreeBSD (pthreads) To: mira!lambert.org!terry@werple.net.au (Terry Lambert) Date: Fri, 20 Oct 1995 12:11:06 +1000 (EST) Cc: hackers@freebsd.org, jb@cimlogic.com.au In-Reply-To: <199510200112.SAA03776@phaeton.artisoft.com> from "Terry Lambert" at Oct 19, 95 06:12:35 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@freebsd.org Precedence: bulk > > >usually it's for several blocking IO streams.. > > > > pthreads handles this... > > No it doesn't. To the thread is does *appear* to block. > > But it does this via (I think...) all I/O being nonblocking, and if > > it would block it then run another thread.... > > This is how it runs, period: It changes blocking operations into > non-blocking operations plus a context switch. > > If you get a real blocking operation (ie: one outside the model, etc.), > then all threads are blocked because the context switcher can't run Our scheduler runs on signals, so any calls outside the model are interrupted and the next thread is run. An example of a blocking call that is outside the pthreads model is msgrcv(). In our implementation, a blocking call to msgrcv() will block for its time slice and then be interrupted by a SIGVTALRM so that the next thread runs. The application has to handle the EINTR that is returned to the thread once it gets to run again. Either that or the application has to be written to use IPC_NOWAIT. Either way requires a compromise. > unless it converts the call. Like fstatfs/statfs on a remote but > down server (yit's not a select()'able operation). This should still be interruptable by a signal. > Terry Lambert > terry@lambert.org > --- > Any opinions in this posting are my own and not those of my present > or previous employers. > -- John Birrell CIMlogic Pty Ltd jb@cimlogic.com.au 119 Cecil Street Ph +61 3 9690 9600 South Melbourne Vic 3205 Fax +61 3 9690 6650 Australia Mob +61 18 353 137