Received: from PACIFIC-CARRIER-ANNEX.MIT.EDU by po7.MIT.EDU (5.61/4.7) id AA14743; Thu, 22 Feb 96 15:39:37 EST
Received: from atusks01.aut.alcatel.at by MIT.EDU with SMTP
	id AA18042; Thu, 22 Feb 96 15:39:02 EST
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15499; Thu, 22 Feb 1996 21:39:14 +0100 (MET)
Received: from localhost by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAB21554 ;; Thu, 22 Feb 1996 21:39:12 +0100
Date: Thu, 22 Feb 1996 21:39:12 +0100
From: ELEKTRA-Mailer-Daemon@aut.alcatel.at (Mail Delivery Subsystem)
Subject: Returned mail: too many hops 26 (25 max): from <proven@MIT.EDU> via atusks01, to <pottendo@atusks01>
Message-Id: <199602222039.VAB21554@atusels1.aut.alcatel.at>
To: <proven@MIT.EDU>
To: postmaster@atusks01.aut.alcatel.@.aut.alcatel.at

The original message was received at Thu, 22 Feb 1996 21:39:11 +0100
from atusks01 [146.112.129.10]

   ----- Transcript of session follows -----
554 too many hops 26 (25 max): from <proven@MIT.EDU> via atusks01, to <pottendo@atusks01>

   ----- Original message follows -----
Return-Path: <proven@MIT.EDU>
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21554 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:39:11 +0100
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15488; Thu, 22 Feb 1996 21:39:09 +0100 (MET)
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21547 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:39:07 +0100
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15478; Thu, 22 Feb 1996 21:39:05 +0100 (MET)
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21538 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:39:04 +0100
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15472; Thu, 22 Feb 1996 21:39:02 +0100 (MET)
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21523 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:39:00 +0100
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15469; Thu, 22 Feb 1996 21:38:59 +0100 (MET)
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21518 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:38:58 +0100
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15466; Thu, 22 Feb 1996 21:38:56 +0100 (MET)
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21513 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:38:55 +0100
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15463; Thu, 22 Feb 1996 21:38:54 +0100 (MET)
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21508 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:38:53 +0100
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15460; Thu, 22 Feb 1996 21:38:51 +0100 (MET)
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21503 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:38:50 +0100
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15457; Thu, 22 Feb 1996 21:38:49 +0100 (MET)
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21498 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:38:48 +0100
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15454; Thu, 22 Feb 1996 21:38:46 +0100 (MET)
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21493 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:38:45 +0100
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15451; Thu, 22 Feb 1996 21:38:44 +0100 (MET)
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21488 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:38:43 +0100
Received: from atusels1.aut.alcatel.at by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15446; Thu, 22 Feb 1996 21:38:41 +0100 (MET)
Received: from aut.alcatel.at by atusels1.aut.alcatel.at (SMI-8.6/ELEKTRA-1.0)
	id VAA21481 for <pottendo@atusks01>;; Thu, 22 Feb 1996 21:38:39 +0100
Received: from MIT.EDU by aut.alcatel.at (8.7.2/AAA_1)
	id VAA15442; Thu, 22 Feb 1996 21:38:36 +0100 (MET)
Received: from YAZ-PISTACHIO.MIT.EDU by MIT.EDU with SMTP
	id AA22959; Thu, 22 Feb 96 14:00:51 EST
Received: by yaz-pistachio.MIT.EDU (5.57/4.7) id AA05429; Thu, 22 Feb 96 14:01:19 -0500
Message-Id: <9602221901.AA05429@yaz-pistachio.MIT.EDU>
To: Todd Enersen <tee@dgsystems.com>
Cc: pthreads@MIT.EDU
Subject: Re: pthreads, read() and linux 
In-Reply-To: Your message of "Wed, 21 Feb 1996 17:38:47 PST."
             <Pine.SOL.3.91.960221173441.29692A-100000@eggo.dgsystems.com> 
Date: Thu, 22 Feb 1996 14:01:17 EST
From: Christopher Provenzano  <proven@MIT.EDU>
content-length: 1244


> 
> I've written a device driver under Linux 1.[23].X that doesn't seem to be 
> Pthreads combatible.  Basically, one thread is reading from the device 
> driver and posting events to a second thread, which is dealing with said 
> events.  The read() in the first thread basically causes the second 
> thread from executing, since it is a blocking read().  
> 
> My question is:  Must all calls to read() be non-blocking in a Pthread 
> environment?  And if so, does the standard C library handle this by 
> wrapping the read() and open() calls with ones that enforce a 
> non-blocking paradigm?

So long as the driver supports non-blocking I/O, a thread may do a blocking
read() and the thread engine (called from the read() wrapper routine) will 
ensure that only the thread is blocked. If the driver does not support
non-blocking I/O then the right thing won't happen until I add support 
for kernel threads (using the clone() call provided).

Basicly the thread engine has wrapper routines for most blocking syscalls
and does a best attempt to ensure that the call will only block the thread
and not the entire process. This works well for sockets, pipes, ttys etc
and fails for files and devices that don't honor non-blocking I/O. 

CAP

