Add flags to asymmetric mem barrier
authorDave Watson <davejwatson@fb.com>
Wed, 21 Jun 2017 17:54:54 +0000 (10:54 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 21 Jun 2017 17:57:01 +0000 (10:57 -0700)
commit614cc8c369e104da1daeffe7f9d29d513ebac7e5
tree7cad9609177c35731f54f8459bd7532aa72586b9
parent08f64cbb466e2db910312d26beb4a2bf486367b6
Add flags to asymmetric mem barrier

Summary:
Original sys_membarrier call supported an EXPEDITED flag, that was much faster than the current version, at some extra CPU cost.

The basic idea was a normal one would be used in a background thread, while EXPEDITED would be useful inline in foreground threads.

Add the flag here, and use the mprotect hack until sys_membarrier supports both.

Reviewed By: magedm

Differential Revision: D5292680

fbshipit-source-id: 30edf27514976991bbaa8e776a7138eb815ade36
folly/experimental/AsymmetricMemoryBarrier.cpp
folly/experimental/AsymmetricMemoryBarrier.h