I'm really confused about async-await
s, pool
s and thread
s. The main problem starts with this question: "What can I do when I have to handle 10k socket I/O?" (aka The C10k Problem).
- First, I tried to make a custom pooling architecture with threads
that uses one main
Queue
and multipleThread
s to process all incoming datas. It was a great experience about understandingthread-safety
andmulti-threading
butthread
is an overkill withasync-await
nowadays. - Later, I implemented a simple architecture with
async-await
but I can't understand why "The async and await keywords don't cause additional threads to be created." (from MSDN)? I think there must be somethread
s to do jobs like BackgroundWorker. - Finally, I implemented another architecture with
ThreadPool
and it looks like my first custom pooling.
Now, I think there should be someone else with me who confused about handling The C10k. My project is a dedicated (central) server for my game project that is hub/lobby server like MCSG's lobbies or COD's matchmaking servers. I'll do the login operations, game server command executions/queries and information serving (like version, patch).
Last part might be more specific about my project but I really need some good suggestions about real world solutions about multiple (heavy) data handling.
(Also yes, 1k-10k-100k connection handling depending on server hardware but this is a general question)
The key point: Choosing Between the Task Parallel Library and the ThreadPool (MSDN Blog)
[ADDITIONAL] Good (basic) things to read who wants to understand what are we talking about: