Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job system #245

Closed
afritz1 opened this issue Mar 24, 2023 · 1 comment
Closed

Job system #245

afritz1 opened this issue Mar 24, 2023 · 1 comment
Milestone

Comments

@afritz1
Copy link
Owner

afritz1 commented Mar 24, 2023

The engine is lacking a good way of utilizing several threads. After the software rendering is optimized for single-threaded execution in part 3, it will switch to this job system so pixel shading, etc. can run 5-20x faster.

Off the top of my head, the job system needs a private thread pool and some kind of addJob(), isRunning(), and wait() functions. Maybe it could have a queue of std::function<void()> and worker threads would check if the queue is not empty. Later, wait() could take a category tag so it only waits for certain jobs to finish. Basically the job system exists so we don't have to use condition variables directly.

I am a bit shy of threading due to how easily bugs can show up, but the gains in the renderer and elsewhere would be massive.

@afritz1 afritz1 added this to the 0.15.0 milestone Mar 24, 2023
This was referenced Mar 25, 2023
@afritz1
Copy link
Owner Author

afritz1 commented Jul 14, 2024

The software renderer is using its own implementation that's enough for now. Don't need to multi-thread anything else yet.

@afritz1 afritz1 closed this as completed Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant