oneTBB
oneTBB copied to clipboard
Replace semaphore_t on dispatch_semaphore_t on macOS
Signed-off-by: pavelkumbrasev [email protected]
Description
To enable ThreadSanitizer on APPLE (basically on macOS) replaced semaphore_t on dispatch_semaphore_t which supports via ThreadSanitizer. In accordance to scenarios where and how we use semaphore the performance should not change, but still need to prove this.
Fixes # - #358
- [x] - git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details)
Type of change
Choose one or multiple, leave empty if none of the other choices apply
Add a respective label(s) to PR if you have permissions
- [ ] bug fix - change that fixes an issue
- [x] new feature - change that adds functionality
- [ ] tests - change in tests
- [ ] infrastructure - change in infrastructure and CI
- [ ] documentation - documentation update
Tests
- [ ] added - required for new features and some bug fixes
- [x] not needed
Documentation
- [ ] updated in # - add PR number
- [ ] needs to be updated
- [x] not needed
Breaks backward compatibility
- [ ] Yes
- [x] No
- [ ] Unknown
Notify the following users
@phprus
Other information
Does this change introduce any new dependencies for either compilation/link time or execution time which need to be documented?
Do we know that the dispatch semaphore has no spurious wakeups?
Does this change introduce any new dependencies for either compilation/link time or execution time which need to be documented?
Do we know that the dispatch semaphore has no spurious wakeups?
I currently researching both questions. For now I checked that dispatch_semaphore_t introduced with macOS 10.6. Also I did not observe any new flags during the compilation. (I compiled example from #358 using dispatch_semaphore_t without any additional flags)
It seems that from dispatch_semaphore_t documentation there should not be spurious wakeups during wait
calls. Also from the implementation point of view they have similar while loop on case DISPATCH_TIME_FOREVER
.
Tested on mac os 12.6, and I can easily see that I don't have many false positives as I had without this patch.
Hello, any news on this PR? Can it be merged?
Hi @natale-p, we are going to merge it after we will satisfy all test requirements for it. (I hope it will be soon)