Re: Multithread safety



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
>
>
>


.



Relevant Pages

  • Re: Nat router
    ... C or C++ and sockets of course, ... Alexander Nickolov ... Microsoft MVP, MCSD ... which offers PHP ver. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Raw sockets on Vista with IPPROTO_ICMP
    ... Microsoft MVP, MCSD ... I'm trying to keep my ping program up to date with Vista. ... around raw sockets changed in XP SP2 and again under Vista. ...
    (microsoft.public.win32.programmer.networks)
  • Re: WSAWaitForMultipleEvents wait of > max events techniques
    ... Microsoft MVP, MCSD ... are more than 64 sockets, and WSAWaitForMultipleEvents() ... WSAWaitForMultipleEvents(sockets 64-127, timeout); ...
    (microsoft.public.win32.programmer.networks)
  • Re: Nat router
    ... If I'm eight PHP supports sockets also. ... Microsoft MVP, MCSD ...
    (microsoft.public.win32.programmer.networks)
  • Re: ActiveX controls in IE
    ... the microsoft.public.inetsdk newsgroups ... Sheng Jiang ... Microsoft MVP in VC++ ... use sockets, ...
    (microsoft.public.dotnet.languages.csharp)