Skip to content

Commit c0c82dd

Browse files
committed
Updated README and yardoc.
1 parent 2014056 commit c0c82dd

File tree

3 files changed

+28
-60
lines changed

3 files changed

+28
-60
lines changed

README.md

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -62,61 +62,59 @@ This library contains a variety of concurrency abstractions at high and low leve
6262
#### General-purpose Concurrency Abstractions
6363

6464
* [Async](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Async.html): A mixin module that provides simple asynchronous behavior to any standard class/object or object.
65-
* [Atom](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Atom.html): A way to manage shared, synchronous, independent state.
6665
* [Future](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Future.html): An asynchronous operation that produces a value.
6766
* [Dataflow](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent.html#dataflow-class_method): Built on Futures, Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available.
6867
* [Promise](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Promise.html): Similar to Futures, with more features.
6968
* [ScheduledTask](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ScheduledTask.html): Like a Future scheduled for a specific future time.
7069
* [TimerTask](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/TimerTask.html): A Thread that periodically wakes up to perform work at regular intervals.
7170

72-
#### Thread-safe Collection Classes
71+
#### Thread-safe Value Objects, Structures, and Collections
7372

74-
These classes were originally part of the (deprecated) `thread_safe` gem.
73+
Collection classes that were originally part of the (deprecated) `thread_safe` gem:
7574

7675
* [Array](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Array.html) A thread-safe subclass of Ruby's standard [Array](http://ruby-doc.org/core-2.2.0/Array.html).
7776
* [Hash](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Hash.html) A thread-safe subclass of Ruby's standard [Hash](http://ruby-doc.org/core-2.2.0/Hash.html).
7877
* [Map](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Map.html) A hash-like object that should have much better performance characteristics, especially under high concurrency, than `Concurrent::Hash`.
78+
* [Tuple](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Tuple.html) A fixed size array with volatile (synchronized, thread safe) getters/setters.
7979

80-
#### Thread-safe Value Objects
80+
Value objects inspired by other languages:
8181

82+
* [Atom](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Atom.html): A way to manage shared, synchronous, independent state.
8283
* [Maybe](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Maybe.html) A thread-safe, immutable object representing an optional value, based on
8384
[Haskell Data.Maybe](https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html).
8485
* [Delay](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Delay.html) Lazy evaluation of a block yielding an immutable result. Based on Clojure's
8586
[delay](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Delay.html).
8687

87-
#### Thread-safe Structures
88-
89-
Derived from Ruby's [Struct](http://ruby-doc.org/core-2.2.0/Struct.html):
88+
Structure classes derived from Ruby's [Struct](http://ruby-doc.org/core-2.2.0/Struct.html):
9089

9190
* [ImmutableStruct](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ImmutableStruct.html) Immutable struct where values are set at construction and cannot be changed later.
9291
* [MutableStruct](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/MutableStruct.html) Synchronized, mutable struct where values can be safely changed at any time.
9392
* [SettableStruct](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/SettableStruct.html) Synchronized, write-once struct where values can be set at most once, either at construction or any time thereafter.
94-
* [Tuple](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Tuple.html) A fixed size array with volatile (synchronized, thread safe) getters/setters.
93+
94+
Thread-safe variables:
95+
96+
* [AtomicBoolean](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/AtomicBoolean.html) A boolean value that can be updated atomically.
97+
* [AtomicFixnum](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/AtomicFixnum.html) A numeric value that can be updated atomically.
98+
* [AtomicReference](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/MutexAtomic.html) An object reference that may be updated atomically.
99+
* [ThreadLocalVar](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ThreadLocalVar.html) A variable where the value is different for each thread.
100+
* [Volatile](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Volatile.html)
101+
Provides `volatile` (in the JVM's sense) attribute accessors implemented atop of `Concurrent::AtomicReference`.
95102

96103
#### Java-inspired ThreadPools and Other Executors
97104

98105
* See the [thread pool](http://ruby-concurrency.github.io/concurrent-ruby/file.thread_pools.html) overview, which also contains a list of other Executors available.
99106

100107
#### Thread Synchronization Classes and Algorithms
101108

102-
* [CountdownLatch](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/CountDownLatch.html)
103-
* [CyclicBarrier](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/CyclicBarrier.html)
104-
* [Event](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Event.html)
105-
* [Semaphore](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Semaphore.html)
106-
107-
#### Thread-safe Variables
108-
109-
* [AtomicBoolean](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/AtomicBoolean.html)
110-
* [AtomicFixnum](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/AtomicFixnum.html)
111-
* [AtomicReference](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/MutexAtomic.html)
112-
* [I-Structures](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/IVar.html) (IVar)
113-
* [M-Structures](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/MVar.html) (MVar)
114-
* [Thread-local variables](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ThreadLocalVar.html)
115-
* [Software transactional memory](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/TVar.html) (TVar)
116-
* [ReadWriteLock](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ReadWriteLock.html)
117-
* [ReentrantReadWriteLock](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ReentrantReadWriteLock.html)
118-
* [Volatile](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Volatile.html)
119-
Provides `volatile` (in the JVM's sense) attribute accessors implemented atop of `Concurrent::AtomicReference`.
109+
* [CountdownLatch](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/CountDownLatch.html) A synchronization object that allows one thread to wait on multiple other threads.
110+
* [CyclicBarrier](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/CyclicBarrier.html) A synchronization aid that allows a set of threads to all wait for each other to reach a common barrier point.
111+
* [Event](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Event.html) Old school kernel-style event.
112+
* [I-Structure](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/IVar.html) (IVar) Similar to a "future" but can be manually assigned once, after which it becomes immutable.
113+
* [M-Structure](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/MVar.html) (MVar) A synchronized single element container.
114+
* [ReadWriteLock](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ReadWriteLock.html) A lock that supports multiple readers but only one writer.
115+
* [ReentrantReadWriteLock](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ReentrantReadWriteLock.html) A read/write lock with reentrant and upgrade features.
116+
* [Semaphore](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Semaphore.html) A counting-based locking mechanism that uses permits.
117+
* [Software transactional memory](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/TVar.html) (TVar) A transactional variable - a single-element container that is used as part of a transaction.
120118

121119
### Edge Features
122120

@@ -138,8 +136,8 @@ be obeyed though. Features developed in `concurrent-ruby-edge` are expected to m
138136
Communicating Sequential Processes (CSP).
139137
* [Exchanger](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Exchanger.html)
140138
* [LazyRegister](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/LazyRegister.html)
141-
* [Atomic Markable Reference](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge/AtomicMarkableReference.html)
142-
* [LockFreeLinked Set](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge/LockFreeLinkedSet.html)
139+
* [AtomicMarkableReference](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge/AtomicMarkableReference.html)
140+
* [LockFreeLinkedSet](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge/LockFreeLinkedSet.html)
143141
* [LockFreeStack](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge/LockFreeStack.html)
144142

145143
#### Statuses:

lib/concurrent/atomic/cyclic_barrier.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module Concurrent
44

5+
# A synchronization aid that allows a set of threads to all wait for each
6+
# other to reach a common barrier point.
57
class CyclicBarrier < Synchronization::Object
68

79
# @!visibility private

lib/concurrent/atomics.rb

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,6 @@
22
#
33
# An object reference that may be updated atomically.
44
#
5-
# Testing with ruby 2.1.2
6-
#
7-
# *** Sequential updates ***
8-
# user system total real
9-
# no lock 0.000000 0.000000 0.000000 ( 0.005502)
10-
# mutex 0.030000 0.000000 0.030000 ( 0.025158)
11-
# MutexAtomicReference 0.100000 0.000000 0.100000 ( 0.103096)
12-
# CAtomicReference 0.040000 0.000000 0.040000 ( 0.034012)
13-
#
14-
# *** Parallel updates ***
15-
# user system total real
16-
# no lock 0.010000 0.000000 0.010000 ( 0.009387)
17-
# mutex 0.030000 0.010000 0.040000 ( 0.032545)
18-
# MutexAtomicReference 0.830000 2.280000 3.110000 ( 2.146622)
19-
# CAtomicReference 0.040000 0.000000 0.040000 ( 0.038332)
20-
#
21-
# Testing with jruby 1.9.3
22-
#
23-
# *** Sequential updates ***
24-
# user system total real
25-
# no lock 0.170000 0.000000 0.170000 ( 0.051000)
26-
# mutex 0.370000 0.010000 0.380000 ( 0.121000)
27-
# MutexAtomicReference 1.530000 0.020000 1.550000 ( 0.471000)
28-
# JavaAtomicReference 0.370000 0.010000 0.380000 ( 0.112000)
29-
#
30-
# *** Parallel updates ***
31-
# user system total real
32-
# no lock 0.390000 0.000000 0.390000 ( 0.105000)
33-
# mutex 0.480000 0.040000 0.520000 ( 0.145000)
34-
# MutexAtomicReference 1.600000 0.180000 1.780000 ( 0.511000)
35-
# JavaAtomicReference 0.460000 0.010000 0.470000 ( 0.131000)
36-
#
375
# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html
386
# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/package-summary.html
397
#

0 commit comments

Comments
 (0)