model-checker-benchmarks.git
11 years agoms-queue: fixup initialization and free lists
Brian Norris [Fri, 8 Mar 2013 23:36:20 +0000 (15:36 -0800)]
ms-queue: fixup initialization and free lists

There are a few things we fix:

1) We shouldn't initialize node[0].next, since node[0] is the 'NULL'
pointer and should never be accessed.

2) The per-thread free list is too restrictive. Now, we generate a list
of free nodes for each thread that can contain up to 4 node indexes.
We only initialize this list with 2 nodes each (so each thread can
expand its free list, if needed). There is some minimal assertion
framework and race detection performed on these lists, just in case.

3) We only initialize those nodes that are placed in the free list.
Accesses to other nodes' 'next' pointer should trigger an uninitialized
loads assertion.

11 years agoms-queue: don't initialize node 0
Brian Norris [Fri, 8 Mar 2013 23:07:50 +0000 (15:07 -0800)]
ms-queue: don't initialize node 0

Node zero *should* be unused, since "0" is the NULL pointer index.
Removing this init will help catch bugs.

11 years agoms-queue: we should never dequeue 0
Brian Norris [Fri, 8 Mar 2013 23:06:06 +0000 (15:06 -0800)]
ms-queue: we should never dequeue 0

The test driver is written so that we should never dequeue 0.

11 years agoms-queue: revert Brian D. changes
Brian Norris [Fri, 8 Mar 2013 22:47:27 +0000 (14:47 -0800)]
ms-queue: revert Brian D. changes

On second (or third or fourth) thought, these changes were ill-advised.
We will make a different set of tweaks shortly.

This reverts commits 647601d3f341bb2a2a79534b3d044c039695839d and
fad3891f3158a4285984bb60415c1e4ebc2b767b.

11 years agowow... i think this version is correct...
Brian Demsky [Fri, 8 Mar 2013 08:38:47 +0000 (00:38 -0800)]
wow...  i think this version is correct...

11 years agomy changes
Brian Demsky [Fri, 8 Mar 2013 07:54:06 +0000 (23:54 -0800)]
my changes

11 years agoms-queue: relax the second load of head/tail
Brian Norris [Fri, 8 Mar 2013 02:09:18 +0000 (18:09 -0800)]
ms-queue: relax the second load of head/tail

11 years agoms-queue: strip down test driver
Brian Norris [Fri, 8 Mar 2013 01:56:23 +0000 (17:56 -0800)]
ms-queue: strip down test driver

+ a few assertions

11 years agoms-queue: relax the queue loads/stores/CAS
Brian Norris [Fri, 8 Mar 2013 01:55:59 +0000 (17:55 -0800)]
ms-queue: relax the queue loads/stores/CAS

11 years agoMakefile: build ms-queue
Brian Norris [Fri, 8 Mar 2013 00:42:10 +0000 (16:42 -0800)]
Makefile: build ms-queue

11 years agodeque: re-insert deleted MODEL_ASSERT()
Brian Norris [Thu, 7 Mar 2013 03:44:09 +0000 (19:44 -0800)]
deque: re-insert deleted MODEL_ASSERT()

11 years agodeque: #include's
Brian Norris [Thu, 7 Mar 2013 03:43:08 +0000 (19:43 -0800)]
deque: #include's

11 years agoMerge branch 'master' of ssh://demsky.eecs.uci.edu/home/git/model-checker-benchmarks
Brian Norris [Thu, 7 Mar 2013 03:35:26 +0000 (19:35 -0800)]
Merge branch 'master' of ssh://demsky.eecs.uci.edu/home/git/model-checker-benchmarks

11 years agoms-queue: begin relaxing
Brian Norris [Thu, 7 Mar 2013 03:32:05 +0000 (19:32 -0800)]
ms-queue: begin relaxing

Not functioning yet.

11 years agodo merge...push right code
Brian Demsky [Thu, 7 Mar 2013 03:33:14 +0000 (19:33 -0800)]
do merge...push right code
Merge branch 'master' of ssh://demsky.eecs.uci.edu/home/git/model-checker-benchmarks

Conflicts:
chase-lev-deque/main.c

11 years agoms-queue: add initialization
Brian Norris [Thu, 7 Mar 2013 03:31:31 +0000 (19:31 -0800)]
ms-queue: add initialization

11 years agodeque: fix bugs in assertion code and move up 3 variables...
Brian Demsky [Thu, 7 Mar 2013 03:13:19 +0000 (19:13 -0800)]
deque: fix bugs in assertion code and move up 3 variables...

11 years agodeque: add MODEL_ASSERT(), fixup #include's
Brian Norris [Thu, 7 Mar 2013 03:10:36 +0000 (19:10 -0800)]
deque: add MODEL_ASSERT(), fixup #include's

11 years agodeque: wrong bug fix before...now the correct one
Brian Demsky [Thu, 7 Mar 2013 03:06:26 +0000 (19:06 -0800)]
deque: wrong bug fix before...now the correct one

11 years agodeque: bug fix...method could return empty
Brian Demsky [Thu, 7 Mar 2013 03:03:53 +0000 (19:03 -0800)]
deque: bug fix...method could return empty

11 years agodeque: add test driver, add print messages for now for resize method and if we pull...
Brian Demsky [Thu, 7 Mar 2013 02:58:10 +0000 (18:58 -0800)]
deque: add test driver, add print messages for now for resize method and if we pull the wrong values

test case exposes model checker bugs :(

11 years agofix bug
Brian Demsky [Thu, 7 Mar 2013 01:55:09 +0000 (17:55 -0800)]
fix bug

11 years agoms-queue: relax the initializations
Brian Norris [Wed, 6 Mar 2013 20:14:10 +0000 (12:14 -0800)]
ms-queue: relax the initializations

11 years agoadd make file, header, and extra code to deque
Brian Demsky [Wed, 6 Mar 2013 20:02:48 +0000 (12:02 -0800)]
add make file, header, and extra code to deque

11 years agoms-queue: fixups, add simple race detection
Brian Norris [Wed, 6 Mar 2013 03:08:32 +0000 (19:08 -0800)]
ms-queue: fixups, add simple race detection

11 years agoms-queue: bugfix - get_ptr() and get_count() were switched
Brian Norris [Wed, 6 Mar 2013 02:17:49 +0000 (18:17 -0800)]
ms-queue: bugfix - get_ptr() and get_count() were switched

I ported the implementation wrong, so that we were extracting bits from
the wrong field.

11 years agoms-queue: cleanups
Brian Norris [Wed, 6 Mar 2013 02:17:25 +0000 (18:17 -0800)]
ms-queue: cleanups

11 years agoms-queue: remove more externs and unintended shared data
Brian Norris [Wed, 6 Mar 2013 01:37:28 +0000 (17:37 -0800)]
ms-queue: remove more externs and unintended shared data

11 years agoms-queue: more cleanup
Brian Norris [Wed, 6 Mar 2013 00:43:14 +0000 (16:43 -0800)]
ms-queue: more cleanup

11 years agoms-queue: cleanups, convert to C11 atomics
Brian Norris [Wed, 6 Mar 2013 00:29:51 +0000 (16:29 -0800)]
ms-queue: cleanups, convert to C11 atomics

This converts the "pointer" to a 64-bit type (unsigned long long, or
'pointer') divided into two 32-bit halves (ptr and count), instead of
using a union of a struct and an 'unsigned long'.

All atomics are seq_cst for now. Once the code all looks a little
better, I'll relax these to reasonable memory orderings.

11 years agomcs-queue -> ms-queue
Brian Norris [Tue, 5 Mar 2013 18:10:53 +0000 (10:10 -0800)]
mcs-queue -> ms-queue

This queue is by Michael and Scott; hence, "M&S".

11 years agomcs-queue: a few changes
Brian Norris [Tue, 5 Mar 2013 18:10:22 +0000 (10:10 -0800)]
mcs-queue: a few changes

11 years agomcs-queue: add Makefile
Brian Norris [Tue, 5 Mar 2013 03:39:39 +0000 (19:39 -0800)]
mcs-queue: add Makefile

11 years agomcs-queue: modifications for compiling
Brian Norris [Tue, 5 Mar 2013 03:38:36 +0000 (19:38 -0800)]
mcs-queue: modifications for compiling

Remove backoff, shmem, fork, etc.

Moving closer to something that can compile.

11 years agomsc-queue: indentation, etc.
Brian Norris [Tue, 5 Mar 2013 02:57:12 +0000 (18:57 -0800)]
msc-queue: indentation, etc.

11 years agomcs-queue: initial checkin
Brian Norris [Tue, 5 Mar 2013 02:52:17 +0000 (18:52 -0800)]
mcs-queue: initial checkin

The "new" queue (i.e., "MCS Queue") code directly from:

  ftp://ftp.cs.rochester.edu/pub/packages/sched_conscious_synch/concurrent_queues/concurrent_queues.tar.gz

Except for the MIPS assembly implementation files and Makefile.

From README:

The compressed tar file in this directory conatins the C code for
the algorithms implemented for the paper

%A Maged M. Michael
%A Michael L. Scott
%T Simple, Fast, and Practical Non-Blocking and Blocking
Concurrent Queue Algorithms
%J PROC of the Fifteenth PODC
%C Philadelphia, PA
%D May 1996
%X 23-26 May 1996
%K tr600
%O Earlier version available as
TR 600,
URCSD,
December 1995

11 years agodeque: use atomic_uintptr_t
Brian Norris [Tue, 5 Mar 2013 01:56:25 +0000 (17:56 -0800)]
deque: use atomic_uintptr_t

'Atomic(Array *)' seems to be a pseudocode type. Just use
atomic_uintptr_t and allow the warnings for now (we could alternatively
use a cast every time).

11 years agodeque: improve compile-ability
Brian Norris [Tue, 5 Mar 2013 01:23:22 +0000 (17:23 -0800)]
deque: improve compile-ability

Add appropriate C headers.
Re-introduce atomic_* and memory_order_* prefixes.

11 years agodeque: add "proven correct" work-stealing Chase-Lev deque
Brian Norris [Tue, 5 Mar 2013 01:00:52 +0000 (17:00 -0800)]
deque: add "proven correct" work-stealing Chase-Lev deque

From the PPoPP 2013 paper "Correct and efficient work-stealing for weak
memory models"

By:

  Nhat Minh LĂȘ
  Antoniu Pop
  Albert Cohen
  Francesco Zappa Nardelli

Citation URL:

  http://dl.acm.org/citation.cfm?id=2442524

11 years agobench.sh: add dekker-fences to benchmark runs
Brian Norris [Tue, 5 Mar 2013 00:57:11 +0000 (16:57 -0800)]
bench.sh: add dekker-fences to benchmark runs

11 years agobench.sh: log more information
Brian Norris [Thu, 28 Feb 2013 18:47:22 +0000 (10:47 -0800)]
bench.sh: log more information

We want the whole timing information and git-log info in our log files.

11 years agobench.sh: don't run tests twice
Brian Norris [Thu, 28 Feb 2013 18:32:18 +0000 (10:32 -0800)]
bench.sh: don't run tests twice

Now that we don't print so much garbage by default, we don't need to run
our tests twice (once with log and once without).

11 years agobench.sh: don't 'grep' output
Brian Norris [Tue, 11 Dec 2012 08:44:08 +0000 (00:44 -0800)]
bench.sh: don't 'grep' output

Model-checker output is concise now, so don't trim it.

11 years agorun.sh: sync up run script with model-checker
Brian Norris [Thu, 6 Dec 2012 23:03:21 +0000 (15:03 -0800)]
run.sh: sync up run script with model-checker

I improved the model-checker.git run script, so paste over the changes.

11 years agoMakefile: build dekker-fences automatically
Brian Norris [Wed, 5 Dec 2012 00:54:48 +0000 (16:54 -0800)]
Makefile: build dekker-fences automatically

11 years agodekker-fences: add Dekker's critical section algorithm
Brian Norris [Wed, 5 Dec 2012 00:54:04 +0000 (16:54 -0800)]
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.

11 years agobench.sh: add spsc-bugfix to benchmark runs pldi2013
Brian Norris [Wed, 14 Nov 2012 03:43:07 +0000 (19:43 -0800)]
bench.sh: add spsc-bugfix to benchmark runs

11 years agoMakefile: build spsc-bugfix by default
Brian Norris [Wed, 14 Nov 2012 02:43:45 +0000 (18:43 -0800)]
Makefile: build spsc-bugfix by default

11 years agospsc-bugfix: fix deadlocked signalling bug
Brian Norris [Wed, 14 Nov 2012 02:39:00 +0000 (18:39 -0800)]
spsc-bugfix: fix deadlocked signalling bug

11 years agospsc-bugfree: make Relacy run exhaustive, fair scheduler
Brian Norris [Wed, 14 Nov 2012 02:38:33 +0000 (18:38 -0800)]
spsc-bugfree: make Relacy run exhaustive, fair scheduler

11 years agospsc-bugfix: duplicate the (buggy) spsc-queue
Brian Norris [Wed, 14 Nov 2012 01:30:30 +0000 (17:30 -0800)]
spsc-bugfix: duplicate the (buggy) spsc-queue

Preparing to fix the deadlock bug.

11 years agounrelacy: instrument relacy-marked normal loads/stores
Brian Norris [Tue, 13 Nov 2012 00:48:30 +0000 (16:48 -0800)]
unrelacy: instrument relacy-marked normal loads/stores

11 years agobench: reconfigure default tests
Brian Norris [Thu, 8 Nov 2012 23:26:02 +0000 (15:26 -0800)]
bench: reconfigure default tests

Now, run the "-noinit" tests for mpmc-queue (2R2W and 1R2W). Also,
switch to using '-f 10 -m 2 -e 1' model-checking parameters.

11 years agompmc-queue: .gitignore
Brian Norris [Thu, 8 Nov 2012 18:04:58 +0000 (10:04 -0800)]
mpmc-queue: .gitignore

11 years agompmc-queue: add "-noinit" builds
Brian Norris [Thu, 8 Nov 2012 18:02:28 +0000 (10:02 -0800)]
mpmc-queue: add "-noinit" builds

Build matching test cases where there is no initial element in the
queue.

11 years agompmc-queue: makefile bugfix
Brian Norris [Thu, 8 Nov 2012 17:59:50 +0000 (09:59 -0800)]
mpmc-queue: makefile bugfix

11 years agompmc-queue: remove duplicate source files
Brian Norris [Thu, 8 Nov 2012 17:54:34 +0000 (09:54 -0800)]
mpmc-queue: remove duplicate source files

11 years agompmc-queue: unify source file again
Brian Norris [Thu, 8 Nov 2012 17:53:11 +0000 (09:53 -0800)]
mpmc-queue: unify source file again

I really didn't want 3 copies of the same source file just to get around
some model-checker snapshotting limitations in argument parsing... So
now, it's a compile-time option to configure the number of reader/writer
threads.

11 years agompmc-queue: fix make clean
Brian Norris [Thu, 8 Nov 2012 17:52:10 +0000 (09:52 -0800)]
mpmc-queue: fix make clean

11 years agospsc-queue: add spsc-relacy build
Brian Norris [Tue, 6 Nov 2012 20:32:52 +0000 (12:32 -0800)]
spsc-queue: add spsc-relacy build

Now we can test a version of spsc-queue using Relacy. There were some
small modifications necessary, so I duplicated the source code, renamed
with "-relacy" in the name.

To use it, you need to do something like the following, from the
spsc-queue directory:

  make RELACYPATH=/path-to-relacy
  ./spsc-relacy

11 years agounrelacy: include <mutex> and <condition_variable>
Brian Norris [Tue, 6 Nov 2012 20:10:39 +0000 (12:10 -0800)]
unrelacy: include <mutex> and <condition_variable>

Relacy expects to have these headers even if they aren't included by the
program.

11 years agospsc-queue: fix some old Relacy syntax (RL_NEW/RL_DELETE)
Brian Norris [Tue, 6 Nov 2012 19:53:05 +0000 (11:53 -0800)]
spsc-queue: fix some old Relacy syntax (RL_NEW/RL_DELETE)

Relacy 2.4 doesn't even have RL_NEW and RL_DELETE, so we shouldn't use
it even if we're trying to be Relacy-compatible.

11 years agounrelacy: use new MODEL_ASSERT() macro
Brian Norris [Sat, 3 Nov 2012 22:54:39 +0000 (15:54 -0700)]
unrelacy: use new MODEL_ASSERT() macro

11 years agobench: allow log directory to be placed elsewhere
Brian Norris [Sat, 3 Nov 2012 03:14:31 +0000 (20:14 -0700)]
bench: allow log directory to be placed elsewhere

Now, you can run:

  ./bench.sh <dir>

e.g.,

  ./bench.sh /tmp

Will create a directory /tmp/run-<date-time> for the logs.

11 years agobench: send timings to stdout, not stderr
Brian Norris [Sat, 3 Nov 2012 02:37:20 +0000 (19:37 -0700)]
bench: send timings to stdout, not stderr

11 years agobench: add linuxrwlocks to benchmark runs
Brian Norris [Sat, 3 Nov 2012 01:44:07 +0000 (18:44 -0700)]
bench: add linuxrwlocks to benchmark runs

11 years agolinuxrwlocks: add linux locks test
Brian Norris [Sat, 3 Nov 2012 01:41:30 +0000 (18:41 -0700)]
linuxrwlocks: add linux locks test

11 years agounrelacy: define the relacy ASSERT macros, fixup rl::var
Brian Norris [Sat, 3 Nov 2012 01:19:34 +0000 (18:19 -0700)]
unrelacy: define the relacy ASSERT macros, fixup rl::var

11 years agobench.sh: change max-reads=2, log to directory
Brian Norris [Sat, 3 Nov 2012 00:39:20 +0000 (17:39 -0700)]
bench.sh: change max-reads=2, log to directory

Pass '-m 2' argument to the model-checker

bench.sh sends all logs to a date-named directory now

11 years agobench.sh: add test script for running benchmarks
Brian Norris [Fri, 2 Nov 2012 23:27:12 +0000 (16:27 -0700)]
bench.sh: add test script for running benchmarks

11 years agompmc-queue: expand to 2R2W, 2R1W, 1R2W tests
Brian Norris [Fri, 2 Nov 2012 23:23:10 +0000 (16:23 -0700)]
mpmc-queue: expand to 2R2W, 2R1W, 1R2W tests

I rewrote the test to allow a configurable number of readers and
writers, but then I figured out that our model-checker doesn't support
optarg() and its global optind properly, when using mmap()/mprotect()
snapshotting (it doesn't add the optarg library to be snapshotted...)

So, this test grows to 3 separate source files, at least for now. The
only change is the number of reader and writer threads.

11 years agobarrier: modify to allow more than one reader
Brian Norris [Fri, 2 Nov 2012 04:57:22 +0000 (21:57 -0700)]
barrier: modify to allow more than one reader

Just change the NUMREADERS macro to add more reader-threads.

Having 3 or more threads is a more interesting example, since there's
no contention if you just have one thread spin, waiting for the other.

11 years agompmc-queue: run more producer/consumer threads
Brian Norris [Thu, 1 Nov 2012 19:22:56 +0000 (12:22 -0700)]
mpmc-queue: run more producer/consumer threads

11 years agomcs-lock: add more locking tests to driver
Brian Norris [Thu, 1 Nov 2012 19:21:22 +0000 (12:21 -0700)]
mcs-lock: add more locking tests to driver

11 years agompmc-queue: improve driver, to read all items from queue
Brian Norris [Thu, 1 Nov 2012 19:19:58 +0000 (12:19 -0700)]
mpmc-queue: improve driver, to read all items from queue

threadB() will now read all currently available items from the queue.

11 years agobenchmarks.mk: -rdynamic is used for linking
Brian Norris [Thu, 1 Nov 2012 19:18:28 +0000 (12:18 -0700)]
benchmarks.mk: -rdynamic is used for linking

11 years agospsc-queue: don't statically construct the queue
Brian Norris [Fri, 12 Oct 2012 17:44:58 +0000 (10:44 -0700)]
spsc-queue: don't statically construct the queue

Our model-checker doesn't support constructors which perform
model-checking actions (e.g, atomic initialization) at load time (e.g.,
in a static execution of the constructor), since this happens before the
model-check object is created. Maybe we'll fix that in the future, but
for now, don't construct the queue at load time.

11 years agospsc-queue: compilable
Brian Norris [Fri, 12 Oct 2012 17:44:01 +0000 (10:44 -0700)]
spsc-queue: compilable

11 years agobenchmarks.mk: don't include base model-checker dir
Brian Norris [Fri, 12 Oct 2012 00:09:18 +0000 (17:09 -0700)]
benchmarks.mk: don't include base model-checker dir

All model-checker headers needed for user-program compilation should be
in $(BASE)/include now, not in $(BASE)/

11 years agospsc-queue: add Makefile, .gitignore
Brian Norris [Thu, 11 Oct 2012 23:45:39 +0000 (16:45 -0700)]
spsc-queue: add Makefile, .gitignore

11 years agowilliams-queue: fixup header
Brian Norris [Thu, 11 Oct 2012 23:40:05 +0000 (16:40 -0700)]
williams-queue: fixup header

Move the constructor lower, so that member definitions appear earlier
than it in the class definition.

Also, don't assign to members of the atomic structure directly; use a
temporary struct then assign the whole struct.

Still won't compile. Seeing linker errors, probably due to the fact that
this code uses a nonstandrad atomic template:
    std::atomic<counted_node_ptr>

Where counted_node_ptr is a struct with int and pointer members. Thus,
it has size of at least 96 bytes (32+64) and so probably isn't really
supported by atomics... I'm not sure where the author came up with this.

    $ g++ williams-queue.cc --std=c++0x
    /tmp/ccPQgiJC.o: In function `lock_free_queue<int>::lock_free_queue()': williams-queue.cc:(.text._ZN15lock_free_queueIiEC2Ev[_ZN15lock_free_queueIiEC5Ev]+0x92): undefined reference to `std::atomic<lock_free_queue<int>::counted_node_ptr>::load(std::memory_order) const'
    ...
    collect2: ld returned 1 exit status

11 years agowilliams-queue: add driver, Makefile, etc.
Brian Norris [Thu, 11 Oct 2012 23:37:37 +0000 (16:37 -0700)]
williams-queue: add driver, Makefile, etc.

Still doesn't quite compile. I'm mostly attempting compilation with a
C++0x compiler (G++ 4.6) for now, a la:

  g++ -o williams-queue williams-queue.cc --std=c++0x

11 years agowilliams-queue: trim excess implementation
Brian Norris [Thu, 11 Oct 2012 23:05:29 +0000 (16:05 -0700)]
williams-queue: trim excess implementation

Trim down to a single implementation. Still doesn't compile correctly.

11 years agowilliams-queue: add lock-free-queue
Brian Norris [Thu, 11 Oct 2012 18:31:03 +0000 (11:31 -0700)]
williams-queue: add lock-free-queue

Lock-free queue code from "C++ Concurrency in Action: Practical
Multithreading", by Anthony Williams

Code taken from:
  http://www.manning.com/williams/CCiA_SourceCode.zip
  http://www.manning.com/williams/

Note that this commit includes several implementation of pieces of the
queue. I will trim them down to a working class in the next step.

11 years agospsc-queue: use std::condition_variable
Brian Norris [Thu, 11 Oct 2012 18:24:11 +0000 (11:24 -0700)]
spsc-queue: use std::condition_variable

Model-checker doesn't support <condition_variable> header yet.

11 years agomcs-lock: driver bugfix (deadlocking)
Brian Norris [Thu, 11 Oct 2012 01:33:27 +0000 (18:33 -0700)]
mcs-lock: driver bugfix (deadlocking)

I didn't notice that the guard automatically locks/unlocks the mutex on
creation/destruction, respectively.

11 years agospsc-queue: fixup atomics, mutexes, threads
Brian Norris [Thu, 11 Oct 2012 01:03:37 +0000 (18:03 -0700)]
spsc-queue: fixup atomics, mutexes, threads

11 years agospsc-queue: unrelacy
Brian Norris [Thu, 11 Oct 2012 00:14:52 +0000 (17:14 -0700)]
spsc-queue: unrelacy

11 years agounrelacy: fixup header
Brian Norris [Thu, 11 Oct 2012 00:13:16 +0000 (17:13 -0700)]
unrelacy: fixup header

11 years agospsc-queue: add new benchmark
Brian Norris [Thu, 11 Oct 2012 00:03:04 +0000 (17:03 -0700)]
spsc-queue: add new benchmark

From:
https://groups.google.com/forum/?fromgroups=#!msg/comp.programming.threads/nSSFT9vKEe0/7eD3ioDg6nEJ

11 years agompmc-queue: driver fixes
Brian Norris [Wed, 10 Oct 2012 23:15:56 +0000 (16:15 -0700)]
mpmc-queue: driver fixes

* Initialize queue with at least one item

* Instrument some racy accesses in driver

* Print a little information to see what kind of loops we're stuck in

11 years agompmc-queue: add top-level Makefile
Brian Norris [Wed, 10 Oct 2012 22:50:48 +0000 (15:50 -0700)]
mpmc-queue: add top-level Makefile

11 years agofixup makefiles
Brian Norris [Wed, 10 Oct 2012 22:41:51 +0000 (15:41 -0700)]
fixup makefiles

11 years agobenchmarks: revert back to strong/weak compare-exchange
Brian Norris [Wed, 10 Oct 2012 22:20:17 +0000 (15:20 -0700)]
benchmarks: revert back to strong/weak compare-exchange

I fixed up the model-checker header, so these will compile.

11 years agompmc-queue: add test driver, Makefile, .gitignore
Brian Norris [Wed, 10 Oct 2012 21:25:33 +0000 (14:25 -0700)]
mpmc-queue: add test driver, Makefile, .gitignore

11 years agompmc-queue: fixup compilation
Brian Norris [Wed, 10 Oct 2012 21:22:26 +0000 (14:22 -0700)]
mpmc-queue: fixup compilation

* Remove "nonatomic" type template
* Don't use atomic<T>(T) constructor
* Don't use compare_exchange_weak()

11 years agompmc-queue: unrelacy
Brian Norris [Wed, 10 Oct 2012 20:59:35 +0000 (13:59 -0700)]
mpmc-queue: unrelacy

11 years agompmc-queue: add MPMC queue header
Brian Norris [Wed, 10 Oct 2012 20:54:56 +0000 (13:54 -0700)]
mpmc-queue: add MPMC queue header

From first example at:
http://cbloomrants.blogspot.com/2011/07/07-30-11-look-at-some-bounded-queues.html

11 years agomcs-lock: write proper driver
Brian Norris [Wed, 10 Oct 2012 18:11:55 +0000 (11:11 -0700)]
mcs-lock: write proper driver

11 years agomcs-lock: bugfix - didn't allocate mcs_mutex
Brian Norris [Wed, 10 Oct 2012 02:08:01 +0000 (19:08 -0700)]
mcs-lock: bugfix - didn't allocate mcs_mutex

This is a bug in the stupid driver I wrote (i.e., my fault). I was
struggling with the syntax, so I forgot to even initialize my objects.