[278] in Pthreads mailing list archive

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

socket io and host lookup

daemon@ATHENA.MIT.EDU (Ian Piumarta)
Mon Feb 26 10:24:18 1996

From: Ian Piumarta <piumarta@prof.inria.fr>
Date: Mon, 26 Feb 1996 15:18:58 +0100
To: pthreads@MIT.EDU


Using Chris's pthreads it appears that I cannot have one thread blocked in a
read() on a socket waiting for data to arrive, while another thread issues a
write() to the same socket.  The read() returns -1 with errno set to 0.
Using DEC's native pthreads implementation on an Alpha it works perfectly.

If course it's easy to fix by using back-to-back pairs of sockets, but this
effectively halves the size of my descriptor table.  Is there any official
position on this sort of "full-duplex" use of sockets in multiple threads?


While I'm here I should also mention something else.  I think it is a serious
shortcoming that gethostbyname() looks only in the DNS, and ignores
/etc/hosts.  On our SunOS machines we first have a local resolution in
/etc/hosts followed by a query to the DNS if no entry is found in the file.
I noticed this when I took some work home: the code ran fine when my modem
and PPP were up (and I had a DNS server at work to query), but failed with
the modem switched off.  Taking out the pthreads stuff to get the native
SunOS behaviour back, it worked with the modem on or off.

I suspect it's the same on OSF1 machines: we unplugged an Alpha a while ago
and it ran just fine with only /etc/hosts and no DNS.

Is there any chance of fixing the behaviour for those poor people like myself
who have to work on netless machines once in a while?  (And local calls *cost
lots* over here, so that isn't a particularly viable solution... ;-)

Cheers,

Ian
------------------------------- projet SOR -------------------------------
Ian Piumarta, INRIA Rocquencourt,          Internet: Ian.Piumarta@inria.fr
BP105, 78153 Le Chesnay Cedex, FRANCE         Voice: +33 1 39 63 52 87
----------------------- Systemes d'Objets Repartis -----------------------

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