-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Input, printing/rendering, game logic will likely each benefit from moving to their own threads.
Ideas:
- Input thread will allow nonblocking interaction
- Required for responsible gameplay
- Game logic thread will process game changes
- Process the rules generating each layer from objects
- Compositor can merge engine output
- Merge the layers into a single layer in parallel as they are generated
- Renderer can be calculating buffers from last composition
- While printing the last frame, the renderer can be preparing the new frame deltas in parallel
- Printer can be printing to the terminal
- Very slow, makes the entire game logic and render calculations wait otherwise
Additional Context
Note: These are untested, and can just as easily degrade performance. Each must be carefully evaluated before widespread use.
+--------------------+ +--------------------+ +--------------------+
| Input Thread | | Game Logic Thread | | Compositor Thread |
| (Non-blocking I/O) | | (State Updates) | | (Layer Merging) |
+--------------------+ +--------------------+ +--------------------+
\ | |
\ v |
\ +--------------------+ |
\-----> | Renderer Thread | <-------------/
| (Buffer Generation) |
+--------------------+
|
v
+--------------------+
| Printer Thread |
| (Terminal Output) |
+--------------------+Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request