[432] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

question about fd sharing

daemon@ATHENA.MIT.EDU (Larry V. Streepy, Jr.)
Mon Sep 30 13:52:25 1996

Date: Mon, 30 Sep 1996 11:33:28 -0600
From: "Larry V. Streepy, Jr." <streepy@healthcare.com>
To: pthreads@MIT.EDU

I have a basic question about the stdio implementation.

Are fd's shared by all threads by default or is there some operation you
can perform to make them shared?

I'm seeing some odd results with this scenario:

1. Create a thread to listen on a socket.
2. When a connection is accepted, create another thread to handle
   the reading and another to handle the writing.

The initial thread sets the socket to non-blocking prior to the
creation of the reader and writer threads.  However, the socket appears
to be blocking when a recv is performed in the reading thread.

Any ideas?

Thanks.
-- 
Larry V. Streepy, Jr.
Chief Technical Officer,  Healthcare Communications, Inc.
mailto:streepy@healthcare.com
(214) 851-7033 (Dallas Main #)
(970) 626-5028 (My office #)			(970) 626-4425  (Fax)

home help back first fref pref prev next nref lref last post