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

Replaces OSSpinLock with pthread_mutex_t #1953

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akkrat
Copy link

@akkrat akkrat commented Aug 24, 2022

Fixing #1785
pthread_mutex_t was chosen because

  1. it's already using on some platforms
  2. os_unfair_lock must be allocated on the heap so it couldn't be used as c++ class member (Concurrent Programming With GCD in Swift 3 or SO)

@dinhvh
Copy link
Member

dinhvh commented Aug 25, 2022

pthread_mutex_t is too slow.
We need to use something faster on iOS / macOS.

@akkrat
Copy link
Author

akkrat commented Sep 5, 2022

libetpan uses pthread_mutex_t too
The other alternatives (such as dispatch semaphore or os_unfair_lock) are not much faster than pthread_mutex_t

@dinhvh
Copy link
Member

dinhvh commented Sep 5, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants