Re: Multithread safety
- From: "Eugene Gershnik" <gershnik@xxxxxxxxxxx>
- Date: Tue, 8 Nov 2005 18:31:28 -0800
Nathan Evans wrote:
>> 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.
>
> Does this apply even when you are using the socket in conjuction with
> a completion port?
Yes. However, note that as with any "undefined behavior" you will not
necessarily see any problem while testing. There are many factors at play
here including buffer sizes, how exactly they are passed between different
layers of system etc. It is a good example of "logically bad" thing to do.
It may work but nobody can really guarantee that it will not break in the
next service pack or even on a different machine.
--
Eugene
http://www.gershnik.com
.
- Follow-Ups:
- Re: Multithread safety
- From: Nathan Evans
- Re: Multithread safety
- References:
- Multithread safety
- From: Mike Gleason Jr Couturier
- Re: Multithread safety
- From: Eugene Gershnik
- Re: Multithread safety
- From: Nathan Evans
- Multithread safety
- Prev by Date: Re: Multithread safety
- Next by Date: Re: Multithread safety
- Previous by thread: Re: Multithread safety
- Next by thread: Re: Multithread safety
- Index(es):