Packages

  • package root
    Definition Classes
    root
  • package io

    This is the documentation for the ThreadCSO Library.

    This is the documentation for the ThreadCSO Library. Notable packages include:

    Definition Classes
    root
  • package threadcso

    The standard threadCSO API.

    The standard threadCSO API. Most modules using CSO will need only the declaration:

    import io.threadcso._

    The present version of the ThreadCSO library API is 1.2Rr (for some number r)

    The revision number (Rr) will change if bugs are corrected but the code remains consistent with the previous API. Its minor version number will change if there is a correction to the code that breaks consistency with the previous API. Its major version will change if there is a substantial change in the semantics of an important CSO construct.

    August 2017: changes 1.1 => 1.2

    • renaming of very many internal classes and packages
    • basic channel implementations are more efficient, in some case much more so
    • alternation reliability improved
    • debugger registration of alternations is no longer needed
    • home-grown semaphores can specify which component they are part of: this makes interpreting a stack backtrace very much easier
    • there is a flexible logging system that is compatible with the debugger

    April 2016: changes 1.0 => 1.1

    • Extended rendezvous read operator is now ?? (was ?)
    • Extended rendezvous read event notation is now =??=> (was =?=>>)
    • The notation inport ? f is now equivalent to f(inport?()) This makes for a tidier layout when the function f is an explicit functional expression.

    Feb 1 2017: changes 1.1R1 => 1.1R2

    • Removed dependencies on deprecated Java->Scala functions: replaced with .asJava
    @author Bernard Sufrin, Oxford
    $Revision: 286 $
    $Date: 2017-11-18 17:41:30 +0000 (Sat, 18 Nov 2017) $
    Definition Classes
    io
  • package alternation
    Definition Classes
    threadcso
  • package basis

    A home for types that are needed more or less pervasively.

    A home for types that are needed more or less pervasively.

    @author Bernard Sufrin, Oxford
    $Revision: 228 $
    $Date: 2016-03-04 16:11:56 +0000 (Fri, 04 Mar 2016)
    Definition Classes
    threadcso
  • package channel

    Specifies primitive (non-alternation-capable) ports and channels; and implements several channel types.

    Specifies primitive (non-alternation-capable) ports and channels; and implements several channel types.

    Definition Classes
    threadcso
  • package component

    A collection of several process-generators that (mostly) yield processes to work on (or produce) finite or infinite streams of values presented as channel.

    A collection of several process-generators that (mostly) yield processes to work on (or produce) finite or infinite streams of values presented as channel. All are designed to terminate cleanly -- 'i.e.' to closeIn or closeOut all the channel.that they communicate on in the appropriate direction for the type of port.

    Some of these components were inspired by (or copied from) components from the Plug'n'Play collection of JCSP (without necessarily retaining the P'n'P names).

    @version 03.20120824
    @author Bernard Sufrin, Oxford
    $Revision: 247 $
    $Date: 2017-10-20 15:00:00 +0100 (Fri, 20 Oct 2017) $
    Definition Classes
    threadcso
  • package debug
    Definition Classes
    threadcso
  • package lock
    Definition Classes
    threadcso
  • package monitor
    Definition Classes
    threadcso
  • package process
    Definition Classes
    threadcso
  • package semaphore
    Definition Classes
    threadcso
  • package jdk
  • BooleanSemaphore
  • CountingSemaphore
  • FastFlag
  • Flag
  • Latch
  • Semaphore
p

io.threadcso

semaphore

package semaphore

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. class BooleanSemaphore extends Semaphore

    A fast boolean semaphore implemented with a nonblocking queue.

    A fast boolean semaphore implemented with a nonblocking queue.

    The object parent (by default the semaphore itself) is used by the debugger when reporting the state of waiting processes.

    The object parent is shown by the debugger when doing stack backtraces.

    The value spin is the number of attempts the semaphore's inbuilt spinlock will make to seize the semaphore before a call to acquire or acquireFast causes the caller to be descheduled. The point of trying with a spinlock first is that the performance-hit of descheduling can be very high. We assume here that more than one processor is available: set spin to 0 or 1 otherwise.

    The fair parameter is ignored.

    To do

    Make the internal spinlock adaptive

  2. class CountingSemaphore extends Semaphore

    A counting semaphore implemented with a nonblocking queue.

    A counting semaphore implemented with a nonblocking queue. In principle the semaphore manages a finite collection of (identical) tokens.

    The object parent (by default the semaphore itself) is used by the debugger when reporting the state of waiting processes.

    The value of available may be negative, in which case it represents a deficit of tokens.

    The value spin is the number of attempts the semaphore's local spinlock will make to acquire a token before a call to acquire or acquireFast causes the caller to be descheduled. The point of trying with a spinlock first is that the performance-hit of descheduling can be very high. We assume here that more than one processor is available: set spin to 0 or 1 otherwise.

    The fair parameter is ignored.

    To do

    Make the internal spinlock adaptive

  3. class FastFlag extends Semaphore

    A high-performance variant of Flag with no intrinsic support for debugging or dynamic error-checking.

    A high-performance variant of Flag with no intrinsic support for debugging or dynamic error-checking. A synchronization object that supports a single thread waiting until some other thread enables it to proceed. Functionally equivalent to (but considerably more efficient than) a BooleanSemaphore(false) that can be released once.

  4. class Flag extends Semaphore

    A synchronization object that supports a single thread waiting until some other thread enables it to proceed.

    A synchronization object that supports a single thread waiting until some other thread enables it to proceed. Functionally equivalent to (but considerably more efficient than) a BooleanSemaphore(false) that can be released once.

  5. class Latch extends AnyRef

    A synchronization object that supports threads waiting until a fixed number of operations being performed in other threads have been completed.

    A synchronization object that supports threads waiting until a fixed number of operations being performed in other threads have been completed.

    A Latch is initialized with a given count. The await methods block until the current count reaches zero through decrement invocations, after which all waiting threads are allowed to proceed and any subsequent invocations of await return immediately. This happens exactly once per latch: its count cannot be reset.

    If the latch is strict then any decrement calls subsequent to the one that makes the count zero will raise an IllegalStateException.

  6. trait Semaphore extends AnyRef

    Trait inherited by all semaphore implementations.

    Trait inherited by all semaphore implementations. All semaphores have available a virtual finite collection of tokens that their clients may acquire and release.

Value Members

  1. object BooleanSemaphore extends NameGenerator

    Semaphore factory.

  2. object CountingSemaphore extends NameGenerator

    Factory for Counting semaphores

  3. object Flag extends NameGenerator
  4. object Latch extends NameGenerator

Ungrouped