Closed vanhaodev closed 1 month ago
Client per task is more like TCP default mechanism where you will need sync all data between peers. Also this is additional context switches which is slow.
One "super feature" of UDP is that you can process 1000 clients in one "task"/thread. 1000 threads for 1000 clients - will be slower.
What do you want to achieve?
Owner I don't use threads, just use async so that client requests don't have to wait for each other. Still the same thread but not waiting for each other. Some computational tasks may take time and other clients must wait. Is it possible for Litenetlib to write that, if so please guide me
Owner I don't use threads, just use async so that client requests don't have to wait for each other. Still the same thread but not waiting for each other. Some computational tasks may take time and other clients must wait. Is it possible for Litenetlib to write that, if so please guide me
async is syntax sugar over threadpool. So they basically threads.
Owner I don't use threads, just use async so that client requests don't have to wait for each other. Still the same thread but not waiting for each other. Some computational tasks may take time and other clients must wait. Is it possible for Litenetlib to write that, if so please guide me
async is syntax sugar over threadpool. So they basically threads.
if litenetlib have any way to handle it, pls help me. Thanks
@vanhaodev it doesn't. This is different approach that need much different architecture
@vanhaodev it doesn't. This is different approach that need much different architecture
Can I write a mmorpg realtime server with this lib? Clients do not wait for each other's task.
@vanhaodev you need to learn MMORPG server architectures of released games. They will not wait for each other's task. If you really have long tasks (like request from DB) you should move them to async/thread. But all other game logic should be in one thread. This is very hard theme and out of scope of this library support
I want to create a while loop in async method for every client. But i see this lib only for single while loop to listen of all client request. Thanks