Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

TheTempest

Multithreaded AND async sockets...?

This topic is 5800 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I've written a simple win32 console app that uses multithreading. The only problem is that the threads are not asyncronus. I'm not quite sure how to impliment the WSASelectAsnyc() fucntion into a mutltithreaded program due to the fact that you have to use the message pump for the window in a REAL windows program. Does ne1 have any snippets or links or general architecture for a program like this? I guess another way of asking is something i saw on a web site, something about using "WSARecv" and a "thread event"?? whats that about? THANKS "There are no such things as stupid questions... Just stupid people " -Me [edited by - TheTempest on October 3, 2002 9:45:49 AM]

Share this post


Link to post
Share on other sites
Advertisement
One solution is an event synchronization. You need to know when to read data and when to wait for data. That is one use of an event kernel object in a Winsock application.

For example, let say you get a notice from WSAAsyc of incoming data. After you start a new thread and read data, there are, however, still data left. One solution is to use an event to pause the worker thread from looping.

Kuphryn

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!