Re: Read from and Write to the same socket from two threads
- From: Charles Zhang <CharlesZhang@xxxxxxxxxxxxxxxxx>
- Date: Mon, 04 Feb 2008 23:19:32 -0800
Thanks. Walter.
The FAQ page means the following:
Anecdotal evidence suggests that one thread calling send() and another thread calling recv() on a single socket is safe on recent Microsoft stacks at least.
Could you confirm the above for me? If it safe to read from one thread and write to the same socket in another thread. I will not want to implement the synchronizations.
Charles Zhang
Walter Wang [MSFT] wrote:
Hi Charles,.
While calling send() in one thread and recv() in another thread is safe, order of winsock functions in two threads on one socket handle might cause other issues. It's recommended to provide thread safety yourself. Please see winsock FAQ on this:
Winsock Programmer's FAQ: Intermediate Winsock Issues (http://tangentsoft.net/wskfaq/intermediate.html#threadsafety)
Hope this helps.
Regards,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
- Follow-Ups:
- References:
- Read from and Write to the same socket from two threads
- From: Charles Zhang
- RE: Read from and Write to the same socket from two threads
- From: "Walter Wang [MSFT]"
- Read from and Write to the same socket from two threads
- Prev by Date: RE: Read from and Write to the same socket from two threads
- Next by Date: Re: No login dialog to connect to shared folder on a server
- Previous by thread: RE: Read from and Write to the same socket from two threads
- Next by thread: Re: Read from and Write to the same socket from two threads
- Index(es):
Relevant Pages
|