Tag Info

New answers tagged

0

Although this is nothing game specific, libuv may be interesting way to implement a server. libuv is the underlying core that is powering node.js, but instead of JavaScript you program in C. (No big deal to integrate into C++.) The key point behind libuv (and node.js for that matter) is that all the high level logic is executed in the main thread and all ...


1

In a single-threaded environment, there is usually nothing wrong with processing events right away when they happen. But in a multi-threaded environment this can lead to race conditions and syncronization issues. For that reason I would recommend you to give each thread an event queue to which other threads can push events. Each thread would lock its event ...


3

A general game loop should suffice, regardless of how many "games" you're handling. I would suggest considering having a threadpool for your "games" and a separate thread pool for your I/O and DB stuff. Say a 16-core server would use 8 threads per pool would be a good start. The concept is that your main thread runs through the current number of active ...



Top 50 recent answers are included