dekker-fences: add Dekker's critical section algorithm
authorBrian Norris <banorris@uci.edu>
Wed, 5 Dec 2012 00:54:04 +0000 (16:54 -0800)
committerBrian Norris <banorris@uci.edu>
Wed, 5 Dec 2012 00:54:04 +0000 (16:54 -0800)
commit3a122c7c1a08bff6cbff5b81f357c5c6efaad84d
tree83f5fc2c2ce288284e69f0b1d494e747bdf1ea8f
parentf0420375f1cec3bb95282dcac083a0ae9ed098b6
dekker-fences: add Dekker's critical section algorithm

Now that we support fences, add a test benchmark that uses fences. This
one just uses seq-cst fences.

Downloaded from:

   http://www.justsoftwaresolutions.co.uk/threading/

Modified to avoid static construction. i.e., change:
  std::atomic<int> turn(0);
to
  std::atomic<int> turn;
  ...
  turn = 0;
And added user_main() method to launch the two threads.
dekker-fences/.gitignore [new file with mode: 0644]
dekker-fences/Makefile [new file with mode: 0644]
dekker-fences/dekker-fences.cc [new file with mode: 0644]