CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Threaded View

  1. #2
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556

    Re: winsock recv incomplete message problem

    If you are sharing the receiveBuffer1 buffer amongst four different threads, then you probably lack synchronization between the threads, such that one thread is writing to the buffer (maybe the main thread) while other threads expect the buffer to be constant.

    Incidentally, creating a new thread is time-consuming, and your code apparently does so for each and every new datagram that's received. A better architecture would be a thread pool, where all threads in the pool are already created, but are in a wait state until work is given to them. That way, there's no overhead lost in thread creation.

    Mike
    Last edited by MikeAThon; October 10th, 2007 at 11:58 AM. Reason: fix typo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured