Files
nim-taskpools/taskpools
Esteban C Borsani bc3bc861b4 Fixes #5; Event notifier is a bottleneck for very small tasks (#54)
Fix #5 ; Ported from [Constantine
threadpool](https://github.com/mratsim/constantine/tree/master/constantine/threadpool)

Changes:

- Implement event count backoff from Constantine
- Fallback to generic futexes. [Constantine errors out
instead](https://github.com/mratsim/constantine/blob/ea8c268603a5c5f5be479dda9ba27dcbdc51dade/constantine/threadpool/primitives/futexes.nim#L18).
- Removed `foreignThreadsParked` redundant logic to match constantine.
- Additional fixes:
  - https://github.com/mratsim/constantine/pull/623
  - https://github.com/mratsim/constantine/pull/624
  - https://github.com/mratsim/constantine/pull/625

In the fib bench, this is ~10x faster. In the SPC it's ~5x faster when
setting task granularity to 1. It's 2x faster in nqueens and heat.

It also does not run into the event notifier race conditions reproduced
by `tests/stress/test_shutdown.nim` that cause a hang.
2026-07-22 05:02:44 -03:00
..
2022-04-06 14:30:09 +02:00