
test_rw_locks

Here are the options to test_rw_locks:

 -i ignore deadlock
 -n <iterations>
 -r <reads>
 -d debug
 -s sleep during writes
 -t <threads>

test_rw_locks spawns <threads> number of threads which perform the
following algorithm:

for <iterations>
  {
    for <reads>
      acquire read lock
    for <reads>
      release read lock
  
    acquire write lock
    if (sleep during writes)
      sleep for 1 second
    release write lock
  }


The output should show that multiple readers can acquire the lock for
reading simultaneously (note that this also tests recursive
acquisition.)  When a writer lock is acquired, the output should show
that no thread holds a reader lock.

To run a test, simply type:
% ./test_rw_lock

This should show output as described above.  Type
% ./test_rw_lock -u
to see usage flags.
