The information in this article applies to:
SYMPTOMSThe LAN Manager 2.2 SOCKDRV.OS2 sockets call recv() will block indefinitely if data is not available in the receive window when called from a separate thread. CAUSESocket data structures are allocated on a per-process basis. When the first thread calls recv() and blocks, flags are set to indicate this. When the second thread calls send() the socket's flags are reset, losing the state information on the blocked recv. This is a classic case of one thread stomping on another by means of the shared data segment. STATUSThis behavior is by design. The problem is avoided if multi-threaded applications send() and recv() on separate sockets. STEPS TO DUPLICATE CONDITIONIf you want to demonstrate this problem, write an application that calls a thread that issues a recv() and then sends data to itself on the same socket. Additional query words: 2.20
Keywords : |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |