Re: Multithread safety
- From: "Mike Gleason Jr Couturier" <mikegleasonjrMAPSON@xxxxxxxxxxxx>
- Date: Fri, 4 Nov 2005 15:13:10 -0500
> Not sure what you mean by exclusively but yes you can read and write
> simultaneously.
> When discussing multi-threading it is important to first determine what is
a
> shared "resource" that you are accessing. In case of a TCP socket there
are
> 3 of them
>
> 1. The socket object itself
> 2. The input TCP stream
> 3. The output TCP stream.
>
> The socket object is thread safe. When you call recv() and send()
> simultaneously nothing in the socket internal data structures will break.
> The streams are separate resources so again recv() on one and send() on
> another are ok.
> What is usually not ok is two simultaneous recv()-s or send()-s. They
access
> the same stream object and any stream is not safe for multiple reads or
> writes.
>
This is exactly what I needed to know.. thank you for your detailed answer !
Mike
.
- References:
- Multithread safety
- From: Mike Gleason Jr Couturier
- Re: Multithread safety
- From: Eugene Gershnik
- Multithread safety
- Prev by Date: Re: Destination host unreachable?
- Next by Date: Re: Multithread safety
- Previous by thread: Re: Multithread safety
- Next by thread: Re: Multithread safety
- Index(es):
Relevant Pages
|