Re: Multithread safety



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





.