Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full support for timeouts #9

Open
mirromutth opened this issue Dec 19, 2023 · 0 comments
Open

Full support for timeouts #9

mirromutth opened this issue Dec 19, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mirromutth
Copy link
Owner

mirromutth commented Dec 19, 2023

For now, futex and sync (with atomic-wait) implementation does not have support for waiting with a timeout.

macOS does have the __ulock_wait syscall that do support a timeout, but it's a private/unstable API

Usage of private APIs can result in software being rejected from Apple's app stores

See also m-ou-se/atomic-wait#4

There have two solutions:

  • Waits for Apple to expose a public API for futex/atomic-wait
  • Implements it as a global pool containing mutexes and condition variables

The last option sounds like the only option I can to do something. But, the most common use case for latch is waiting without timeout. The last option will significantly increase the code size for a rare case.

@mirromutth mirromutth added enhancement New feature or request help wanted Extra attention is needed labels Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant