-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use_file: switch to
futex
on Linux and to nanosleep
on other targ…
…ets (#490) All non-Linux targets only open file in the critical section, so we probably can remove all synchronization and replace it with a sleep-based wait loop. On Linux initialization thread may spend a lot of time in the critical section because of `wait_until_rng_ready`. On entropy-starved (and especially virtualized) systems we may spend tens of seconds in it, so we need a proper synchronization between initializing and waiting threads. Luckily, the `futex` API is a great fit in this case and allows us to efficiently handle the synchronization.
- Loading branch information
Showing
3 changed files
with
173 additions
and
136 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
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