Re: Multithread safety
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Mon, 7 Nov 2005 11:11:17 -0800
BSD Sockets happily support multiple socket I/O on a single
thread. The trick is to use non-blocking sockets and select
judiciously.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Eugene Gershnik" <gershnik@xxxxxxxxxxx> wrote in message
news:el9sJYq4FHA.3880@xxxxxxxxxxxxxxxxxxxxxxx
> 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: Eugene Gershnik
- 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
- Re: Multithread safety
- From: Eugene Gershnik
- Multithread safety
- Prev by Date: Re: Multithread safety
- Next by Date: DNS TEXT and HINFO queries
- Previous by thread: Re: Multithread safety
- Next by thread: Re: Multithread safety
- Index(es):
Relevant Pages
|