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
  • CLOSEDSTATE
  • Chan
  • Closed
  • InPort
  • N2N
  • N2NBuf
  • OneOne
  • OneOneBuf
  • OutPort
  • PortState
  • READYSTATE
  • SharedChan
  • SharedInPort
  • SharedOutPort
  • SyncChan
  • UNKNOWNSTATE
  • 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
p

io.threadcso

channel

package channel

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

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. channel
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type ![-T] = OutPort[T]
  2. type ?[+T] = InPort[T]
  3. trait Chan [T] extends InPort[T] with OutPort[T] with Named[Chan[T]] with debug.REGISTRY.Debuggable
  4. class Closed extends Stopped

    Thrown by an attempt to read from or write to a port that is already closed (or that closes before the termination of the read/write).

  5. trait InPort [+T] extends AnyRef

    A channel is a sequential conduit for data that is written to its OutPort, and subsequently read from its InPort.

    A channel is a sequential conduit for data that is written to its OutPort, and subsequently read from its InPort.

    For most normal channels at any instant: the sequence of data that has been read from the channel with ? is a prefix of the sequence of data written to the channel by !. Dropping channels may drop data under conditions of congestion: precise behaviours of such channels should be documented with their definitions.

  6. class N2N [T] extends OneOne[T] with SharedChan[T]

    Synchronized shared channel to support communication between writers writers and readers readers.

    Synchronized shared channel to support communication between writers writers and readers readers. Closes completely when closeOut has been invoked writers times, or closeIn has been invoked readers times. If either writers or readers is non-positive, then the channel can be closed an unbounded number of times in the associated direction.

    There is no check for writer-overtaking in an N2N(1,_) or for reader-overtaking in an N2N(_, 1). Both ends of an N2N behave as if they were shared.

    The fairOut and fairIn parameters control whether processes are FIFO-queued to use the output/input side of the underlying synchronous channel when there is heavy contention. They both default to false -- for efficiency when there is little contention.

    T

    type of value transmitted by the buffer

  7. class N2NBuf [T] extends SharedChan[T]

    A general-purpose shared buffered channel, bounded by size if it is positive, and unbounded otherwise.

    A general-purpose shared buffered channel, bounded by size if it is positive, and unbounded otherwise.

    The buffer can be shared by any number of readers and writers.

    It closes completely when closeIn has been invoked readers times, or closeOut has been invoked writers times and the buffer has been emptied.

    If either writers or readers is non-positive, then the channel can be closed an unbounded number of times in the associated direction.

    There is no attempt to ensure fairness between sharing writers or sharing readers.

    T

    type of value transmitted by the buffer

  8. class OneOne [T] extends SyncChan[T]

    A synchronized channel to be used by at most one reader and writer process simultaneously.

    A synchronized channel to be used by at most one reader and writer process simultaneously. There are dynamic checks for simultaneous multiple reads (writes), but they are are incomplete. They cannot reliably detect that multiple readers (writers) are running concurrently with a single writer (reader) that is fast enough to keep up with their read (write) rate.

    The channel closes when either closeOut() or closeIn() or close() is invoked.

    T

    the type of message transmitted by the channel

  9. class OneOneBuf [T] extends N2NBuf[T]

    A general-purpose shared buffered channel, bounded by size if it is positive, and unbounded otherwise.

    A general-purpose shared buffered channel, bounded by size if it is positive, and unbounded otherwise.

    The buffer can be shared by any number of readers and writers simultaneously, and (unlike OneOne channel) there is no dynamic check for reader-overtaking (more than a single process trying to read simultaneously) or writer overtaking.

    It closes completely after closeIn has been invoked, or after closeOut has been invoked and the buffer is empty.

    T

    type of value transmitted by the buffer

  10. trait OutPort [-T] extends AnyRef

    A channel is a sequential conduit for data that is written to its OutPort, and subsequently read from its InPort.

    A channel is a sequential conduit for data that is written to its OutPort, and subsequently read from its InPort.

    For most normal channels at any instant: the sequence of data that has been read from the channel with ? is a prefix of the sequence of data written to the channel by !. Dropping channels may drop data under conditions of congestion.

  11. sealed trait PortState extends AnyRef

    A type denoting the state of readiness/commitment of a port.

    A type denoting the state of readiness/commitment of a port. Used in the implementation of alternations.

  12. trait SharedChan [T] extends Chan[T] with SharedOutPort[T] with SharedInPort[T]

    A channel whose input and output ports may each be shared

  13. trait SharedInPort [+T] extends InPort[T]

    An input port that may be shared among several readers simultaneously.

  14. trait SharedOutPort [-T] extends OutPort[T]

    An output port that may be shared among several writers simultaneously.

  15. trait SyncChan [T] extends Chan[T]

    A channel that is guaranteed to be synchronous

Value Members

  1. object CLOSEDSTATE extends PortState with Product with Serializable

    The port is closed

  2. object N2N extends NameGenerator

    Static generator(s) for shared synchronized channel

    Static generator(s) for shared synchronized channel

    See also

    io.threadcso.channel.N2N

  3. object N2NBuf extends NameGenerator

    Static generator for N2NBuf

    Static generator for N2NBuf

    See also

    io.threadcso.channel.N2NBuf

  4. object OneOne extends NameGenerator

    Static generator for OneOne channel.

    Static generator for OneOne channel.

    See also

    io.threadcso.channel.OneOne

  5. object OneOneBuf extends NameGenerator

    Static generator for OneOneBuf

    Static generator for OneOneBuf

    See also

    io.threadcso.channel.OneOneBuf

  6. object READYSTATE extends PortState with Product with Serializable

    The port's channel is in a state that guarantees the next unconditional input (on an InPort) or output (on an OutPort) action on the port can be invoked with no danger of an unbounded wait because:

    The port's channel is in a state that guarantees the next unconditional input (on an InPort) or output (on an OutPort) action on the port can be invoked with no danger of an unbounded wait because:

    • In the case of a synchronized channel, a peer has (already) committed to the complementary output/input on the dual port, or
    • In the case of a buffer, the buffer is in an appropriate state, viz: nonempty for an InPort to be ready, and nonfull for an OutPort to be ready.
  7. object UNKNOWNSTATE extends PortState with Product with Serializable

    The readiness of the port is unknown

Inherited from AnyRef

Inherited from Any

Ungrouped