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

Add threading #6

Closed
wants to merge 5 commits into from
Closed

Conversation

ChickChicky
Copy link

@ChickChicky ChickChicky commented Nov 5, 2024

I added really crude (optional) threading to render_pixels as a new function render_pixels_threaded.

On my machine, with 5000x5000 and 12 threads, I went from 3'08 without threads down to only 45" when enabling them.

@ChickChicky
Copy link
Author

ChickChicky commented Nov 5, 2024

Also, there's currently no support for Windows, so I'll try implementing it tomorrow.

* Fixed leftover hard-coded srand
* Fixed threads implementation for Windows
* Changed thread architecture (result is now passed through parameters)
@ChickChicky
Copy link
Author

820dd69 should make threads work on Windows, with #8.

* Removed THREAD_ENABLE
* Threads are now enabled if N_THREADS is above zero
* Removed useless `volatile` qualifier
* Moved `render_thread_params` declaration
* Moved thread objects into parms to remove one malloc call
* Added a bit of logging (could probably be removed, though)
@ChickChicky
Copy link
Author

Now, the issue is that it only uses the global arena, and as such, prevents all threading.
It would either require to introduce back the arena parameter or make a fork, but I'm not sure if there's a way to do the latter one without a huge overhead.

@ChickChicky
Copy link
Author

#16 Looks way more promising

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant