|
|
|
|
|
by Animats
12 days ago
|
|
Threads. I have a graphics program that has about eight different threads doing different things. The draw thread is high priority and does only the things that have to be done on the draw thread. The update thread, medium priority, is doing change events that affect the scene. The movement thread is doing repeated per-frame movement, computed in parallel with drawing. The asset-loading threads, low priority, are making blocking HTTPS requests to get assets from remote servers, and decompressing them, the biggest compute load. Plus there are a few other threads that do various intermittent tasks. This works well in Rust because the language catches locking errors that cause race conditions. Doing this in C++ would be tough. You don't really need async until you have thousands of things waiting. |
|