-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multithreaded sieve of Atkin. (#158)
* Made algorithms 3.1, 3.2, 3.3, 4.1, 4.2 and 4.3 static. * Because `self` cannot be passed to worker threads. * Producer and consumer proof-of-concept using transmitter and receiver channels. * Is slower, probably because of the constant message passing. * On GitHub Actions, the test workflow gets cancelled because of excessive memory usage. * Could be because the message buffer gets filled faster than it can be consumed. * Updated to copy sieves between threads and combine them afterwards. * This increases the memory usage by a precise amount (the number of threads) rather than indefinitely. * Serial test runs to allow use of 4 cores on macOS 13. * Undid this change, because tests were running faster on Ubuntu. * But kept a macOS 13 runner for sanity, because it runs on an M1 CPU. * Tried combining the copies of the sieves while updating the main sieve. * Slower than combining first and updating in another loop, so reverted.
- Loading branch information
Showing
2 changed files
with
52 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters