• Advertisement
Sign in to follow this  

IOCP threads

This topic is 3656 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

Does having different threads one for sending and another for recv have any benefits? And if its good way is there any tutorial about it.

Share this post


Link to post
Share on other sites
Advertisement
The whole point of IOCP is that you have a thread pool. These threads are then invoked as needed and run your code. As such, IOCP is multi-threaded by definition.

But, tasks are invoked in threads as needed. This means that no matter how big your pool is, only a minimally necessary number of threads in it will be active at any given time. Realistic number will be around 2x the number of cores.

When you look into IOCP event handling, you'll notice that code is operation agnostic - there is no strict distinction between send and receive - you respond to events.

OS takes care of everything else, including invoking event handlers in separate threads, if needed.

So no, having manually managed send/receive threads doesn't make sense with IOCP.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement