package lock
Type Members
-
class
AndBarrier
extends CombiningBarrier[Boolean]
A
CombiningBarrier
withe=true
andop=_&&_
-
class
Barrier
extends AnyRef
A
Barrier(n)
supports the repeated synchronization ofn
processes.A
Barrier(n)
supports the repeated synchronization ofn
processes. Ifb
is such a barrier thenb.sync
calls are stalled untiln
have been made. Whenn==1
thenb.sync
returns immediately: this is so multi-worker structures can be tested with only a single-worker, and may be helpful when testing cellular automata.This implementation is simple-minded.
$Revision: 239 $ $Date: 2017-10-12 18:54:09 +0100 (Thu, 12 Oct 2017) $
-
class
CombiningBarrier
[T] extends AnyRef
A
CombiningBarrier(n, e, _ ⊕ _)
supports the (repeated) synchronization ofn
processes.A
CombiningBarrier(n, e, _ ⊕ _)
supports the (repeated) synchronization ofn
processes. Ifb
is such a barrier thenb.sync(x)
calls are stalled untiln
have been made. We say that such a call contributesx
. If the syncing calls contributex1
,x2
, ...xn
then the value they all return ise ⊕ x1 ⊕ ... ⊕ xn
. The function⊕
must be associative.$Revision: 239 $ $Date: 2017-10-12 18:54:09 +0100 (Thu, 12 Oct 2017) $
-
class
JavaLock
extends ReentrantLock with Lock
Reentrant lock implementation that uses the
jdk.util.concurrent.lock.ReentrantLock
class.Reentrant lock implementation that uses the
jdk.util.concurrent.lock.ReentrantLock
class. Iffair
is true then the lock is first-come first-served. Under heavy contention this can be useful, but it imposes a significant performance penalty on the acquisition of the lock. - trait Lock extends AnyRef
-
class
OrBarrier
extends CombiningBarrier[Boolean]
A
CombiningBarrier
withe=false
andop=_||_
-
class
SimpleLock
extends BooleanSemaphore with Lock
A boolean semaphore viewed as a non-reentrant lock implementation