rust/src/libstd/unstable
bors 6df66c194d auto merge of #7109 : bblum/rust/rwlocks, r=brson
r? @brson

links to issues: #7065 the race that's fixed; #7066 the perf improvement I added. There are also some minor cleanup commits here.

To measure the performance improvement from replacing the exclusive with an atomic uint, I edited the ```msgsend-ring-rw-arcs``` bench test to do a ```write_downgrade``` instead of just a ```write```, so that it stressed the code paths that accessed ```read_count```. (At first I was still using ```write``` and saw no performance difference whatsoever, whoooops.)

The bench test measures how long it takes to send 1,000,000 messages by using rwarcs to emulate pipes. I also measured the performance difference imposed by the fix to the ```access_lock``` race (which involves taking an extra semaphore in the ```cond.wait()``` path). The net result is that fixing the race imposes a 4% to 5% slowdown, but doing the atomic uint optimization gives a 6% to 8% speedup.

Note that this speedup will be most visible in read- or downgrade-heavy workloads. If an RWARC's only users are writers, the optimization doesn't matter. All the same, I think this more than justifies the extra complexity I mentioned in #7066.

The raw numbers are:
```
with xadd read count
        before write_cond fix
                4.18 to 4.26 us/message
        with write_cond fix
                4.35 to 4.39 us/message
                
with exclusive read count
        before write_cond fix
                4.41 to 4.47 us/message
        with write_cond fix
                4.65 to 4.76 us/message
```
2013-06-15 04:07:03 -07:00
..
at_exit.rs libstd: Rename libcore to libstd and libstd to libextra; update makefiles. 2013-05-22 21:57:05 -07:00
atomics.rs Document unstable::atomics fetch_* return values 2013-06-12 20:53:40 -04:00
dynamic_lib.rs Prototyped a dynamic library facility interface 2013-06-12 17:32:13 -07:00
exchange_alloc.rs libstd: Rename libcore to libstd and libstd to libextra; update makefiles. 2013-05-22 21:57:05 -07:00
extfmt.rs std: remove substr & str::count_*, methodise char_len, implement slice_chars. 2013-06-12 12:21:04 +10:00
finally.rs Add a finally impl for extern "Rust" fn() 2013-06-11 12:40:40 -07:00
global.rs libstd: Rename libcore to libstd and libstd to libextra; update makefiles. 2013-05-22 21:57:05 -07:00
intrinsics.rs add memset32/memset64 2013-05-26 10:26:03 -04:00
lang.rs std: convert str::reserve* to methods, and methodise str::push_*. 2013-06-10 23:02:55 +10:00
mod.rs Prototyped a dynamic library facility interface 2013-06-12 17:32:13 -07:00
simd.rs libstd: Rename libcore to libstd and libstd to libextra; update makefiles. 2013-05-22 21:57:05 -07:00
sync.rs Remove all uses of pub impl. rs=style 2013-06-01 09:18:27 -07:00
weak_task.rs std::cell: Modernize constructors 2013-06-04 12:03:58 +02:00