Re: Multithread safety
- From: "Eugene Gershnik" <gershnik@xxxxxxxxxxx>
- Date: Sat, 5 Nov 2005 23:45:21 -0800
Mike Gleason Jr Couturier wrote:
> What I meant to say is : If one thread is writing to
> the socket while another one is reading to it (full-duplex),
> its impossible in certain cases for the writing thread to
> be notified in time by the reading thread that the socket
> has been closed by the peer... So how can I write
> full-duplex production code?
I am not sure what exactly you mean by full-duplex in this context so I'll
assume that you want to read and write simultaneously rather than in
request-response fashion. In this case you need to break the BSD barrier and
use asynchronous I/O offered by Winsock. Unless you need full Unix
compatibility (and even then) it rarely makes sense to limit yourself to
BSD-style sockets only. They were invented in a different world with
different performance characteristics and application architectures than the
one you develop for.
--
Eugene
http://www.gershnik.com
.
- Follow-Ups:
- Re: Multithread safety
- From: Alexander Nickolov
- Re: Multithread safety
- From: Mike Gleason Jr Couturier
- Re: Multithread safety
- References:
- Multithread safety
- From: Mike Gleason Jr Couturier
- Re: Multithread safety
- From: Eugene Gershnik
- Re: Multithread safety
- From: Arkady Frenkel
- Re: Multithread safety
- From: Mike Gleason Jr Couturier
- Re: Multithread safety
- From: Eugene Gershnik
- Re: Multithread safety
- From: Mike Gleason Jr Couturier
- Re: Multithread safety
- From: Mike Gleason Jr Couturier
- Multithread safety
- Prev by Date: Re: Multithread safety
- Next by Date: Re: How do I trap winsock calls in the runtime...
- Previous by thread: Re: Multithread safety
- Next by thread: Re: Multithread safety
- Index(es):
Relevant Pages
|