c3c
c3c copied to clipboard
Could we replace `broadcast()` with `signal()` in these instances?
As far as I understand it we should be able to replace broadcast() with signal() on these lines below. Because we're only adding a single job so only a single waiting thread needs to be notified, not all waiting threads, this should be less expensive, especially with a larger number of threads.
In these places: https://github.com/c3lang/c3c/blob/d143ec227c233e8f99ea3f3c3a1d97e483d5a720/lib/std/threads/fixed_pool.c3#L128 https://github.com/c3lang/c3c/blob/d143ec227c233e8f99ea3f3c3a1d97e483d5a720/lib/std/threads/pool.c3#L100
Typically people will use broadcast because signal can be wonky. But you can try it.