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

'OSMemoryBarrier' is deprecated in macOS 10.12 #345

Closed
khaledhosny opened this issue Oct 10, 2016 · 10 comments
Closed

'OSMemoryBarrier' is deprecated in macOS 10.12 #345

khaledhosny opened this issue Oct 10, 2016 · 10 comments
Assignees

Comments

@khaledhosny
Copy link
Collaborator

Building with latest XCode I got lots of these warnings:

warning: 'OSMemoryBarrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_thread_fence() from <atomic> instead [-Wdeprecated-declarations]
warning: 'OSAtomicAdd32Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add() from <atomic> instead [-Wdeprecated-declarations]
warning: 'OSAtomicCompareAndSwap64Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong() from <atomic> instead [-Wdeprecated-declarations]
@behdad
Copy link
Member

behdad commented Oct 11, 2016

Feel free to patch conditionally. Thanks.

@behdad
Copy link
Member

behdad commented Oct 11, 2016

Maybe we should support C++11 and use atomic on all platforms?

@khaledhosny
Copy link
Collaborator Author

But this would make us dependent on the C++ standard library on all platforms. C11 has a similar C API, may be we can use it if supported by platform/compiler and fallback to existing code otherwise?

@behdad
Copy link
Member

behdad commented Oct 11, 2016

But this would make us dependent on the C++ standard library on all platforms.

Right. Not sure if that's still a concern.

C11 has a similar C API, may be we can use it if supported by platform/compiler and fallback to existing code otherwise?

Whatever works. I do prefer not changing this much as it seems to have been working.

@behdad
Copy link
Member

behdad commented Mar 2, 2017

What's suggested work item here?

@khaledhosny
Copy link
Collaborator Author

Someone familiar with the new C/C++ atomics adds support for them. It should be e.g. used by default when supported and else fall back to the existing implementations. I might give it a try at some point, unless some one beat me to it.

@behdad
Copy link
Member

behdad commented Jun 25, 2017

There's an alternative approach in https://bugs.freedesktop.org/show_bug.cgi?id=90305

Let's give that one a try? I'll find some time to look into #486 as well.

@behdad
Copy link
Member

behdad commented Jun 25, 2017

Also, to make TSan happy, we should replace get_unsafe to do an atomic fetch with memory_order_relaxed ordering instead of being a non-atomic read.

@waywardmonkeys
Copy link
Contributor

My changes in #676 remove this warning by using the compiler primitives rather than the macOS APIs.

@behdad behdad closed this as completed in bda2424 Jul 16, 2018
@behdad
Copy link
Member

behdad commented Jul 16, 2018

Let's see how the bots like my implementation.

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 a pull request may close this issue.

3 participants