These “already parallelized basic functions” are just normal Julia functions. So, you can do the same for your hand-rolled function. For example, if you can rephrase your program as a Divide-and-conquer algorithm, it’s often straightforward to use this strategy. Even if this does not work, as I said in Async limit - #3 by tkf, I’d recommend using the “worker pool” pattern rather than semaphore. For more specific comments, I think it’d be helpful if you can provide an MWE.
tkf
6
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| @threads - control number of threads` | 11 | 486 | May 5, 2025 | |
| Async limit | 3 | 1123 | August 2, 2021 | |
| Limit number of threads from Threads.@threads | 4 | 673 | April 6, 2022 | |
| @threads for only using master thread? | 7 | 1081 | November 24, 2019 | |
| Best way to parallelize for loop with given thread number | 2 | 169 | July 29, 2025 |