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

[MacOS/Darwin] Emulating Futex behaviour #21

Closed
shayanhabibi opened this issue Nov 28, 2021 · 1 comment
Closed

[MacOS/Darwin] Emulating Futex behaviour #21

shayanhabibi opened this issue Nov 28, 2021 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@shayanhabibi
Copy link
Contributor

Issue

Currently I use linux futex and windows waitonaddress to manage backpressure when using Wards and Loony as a threadpool queue.

Mac/Darwin do not have primitives or APIs that are similar.

Solutions

At the moment, I can only think of using conditions and locks.

@shayanhabibi shayanhabibi added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Nov 28, 2021
@shayanhabibi shayanhabibi self-assigned this Nov 28, 2021
@shayanhabibi
Copy link
Contributor Author

shayanhabibi commented Dec 1, 2021

Have decided on using Darwin ulock primitives which are basically futexes.

Issue being they are private functions.

proc ulock_wait*(operation: uint32, address: pointer, value: uint64, timeout: uint32): cint {.importc: "__ulock_wait", cdecl.}

shayanhabibi added a commit that referenced this issue Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant