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 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

class OneOneBuf[T] extends N2NBuf[T]

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

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OneOneBuf
  2. N2NBuf
  3. SharedChan
  4. SharedInPort
  5. SharedOutPort
  6. Chan
  7. Debuggable
  8. Named
  9. OutPort
  10. InPort
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OneOneBuf(size: Int, name: String)

    size

    buffer is bounded by size if it is strictly positive, else unbounded

    name

    name (for the debugger)

Value Members

  1. def !(value: T): Unit

    Output value to the port's channel.

    Output value to the port's channel.

    Definition Classes
    N2NBufOutPort
  2. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  3. final def ##(): Int
    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. def ?[U](f: (T) ⇒ U): U

    Block until a value t is available for input, then return f(t) -- equivalent to f(?()).

    Block until a value t is available for input, then return f(t) -- equivalent to f(?()).

    Definition Classes
    N2NBufInPort
  6. def ?(): T

    Block until a value is available for input, then read and return it.

    Block until a value is available for input, then read and return it.

    Definition Classes
    N2NBufInPort
  7. def ??[U](f: (T) ⇒ U): U

    Block until a value t is available for input, then return f(t).

    Block until a value t is available for input, then return f(t). If the inport is provided by a synchronized channel then synchronisation with the termination of the sender's ! is at the termination of the computation of f(t) (this is sometimes called an extended rendezvous).

    Definition Classes
    N2NBufInPort
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def canInput: Boolean

    Returns false if no further input will be supplied by this port.

    Returns false if no further input will be supplied by this port. Returning true is not a guarantee that further input will be supplied.

    Definition Classes
    N2NBufInPort
  10. def canOutput: Boolean

    Returns false if no further output can be accepted by this port.

    Returns false if no further output can be accepted by this port. Returning true is not a guarantee that further output will be accepted.

    Definition Classes
    N2NBufOutPort
  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def close(): Unit

    Signal that the channel is to be closed forthwith

    Signal that the channel is to be closed forthwith

    Definition Classes
    N2NBufChan
  13. def closeIn(): Unit

    Signal that no further attempts will be made to input from the invoking thread: idempotent

    Signal that no further attempts will be made to input from the invoking thread: idempotent

    Definition Classes
    N2NBufInPort
  14. def closeOut(): Unit

    Signal that no further values will be output from the invoking thread: idempotent

    Signal that no further values will be output from the invoking thread: idempotent

    Definition Classes
    N2NBufOutPort
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def finishedRW: String

    Intelligible information about finished reads and writes

    Intelligible information about finished reads and writes

    Definition Classes
    N2NBuf
    Annotations
    @elidable( FINEST )
  19. def finishedRead: Long

    Increment count of finished reads

    Increment count of finished reads

    Definition Classes
    N2NBuf
    Annotations
    @elidable( FINEST )
  20. def finishedWrite: Long

    Increment count of finished writes

    Increment count of finished writes

    Definition Classes
    N2NBuf
    Annotations
    @elidable( FINEST )
  21. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  22. def getWaiting: Seq[Thread]

    Return a sequence of the threads currently waiting for this object, if any.

    Return a sequence of the threads currently waiting for this object, if any. Default is the empty sequence.

    Definition Classes
    Debuggable
  23. def hasState: Boolean

    This object has a state worth showing right now: false if showState will do no output.

    This object has a state worth showing right now: false if showState will do no output.

    Definition Classes
    Debuggable
  24. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  25. def inPortEvent(portState: PortState): Unit

    The channel has just changed its state in a way that will affect inPortState

    The channel has just changed its state in a way that will affect inPortState

    Definition Classes
    Chan
  26. def inPortState: PortState

    Current state of this port: for alternation implementations

    Current state of this port: for alternation implementations

    Definition Classes
    N2NBufInPort
  27. def isEmpty: Boolean
    Definition Classes
    N2NBuf
    Annotations
    @inline()
  28. def isFull: Boolean
    Definition Classes
    N2NBuf
    Annotations
    @inline()
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. val key: StateKey

    This object's key in the registry (if non-negative)

    This object's key in the registry (if non-negative)

    Definition Classes
    Debuggable
  31. def name: String

    Return the name of the object

    Return the name of the object

    Definition Classes
    Named
  32. def nameGenerator: NameGenerator

    Discover the name generator

    Discover the name generator

    Definition Classes
    N2NBufNamed
  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. def nothing: T

    The null value for this port -- equivalent to null.asInstanceOf[T].

    The null value for this port -- equivalent to null.asInstanceOf[T]. Useful to initialise variables that will in due course be assigned values by reading from the port.

    Definition Classes
    InPort
    Annotations
    @inline()
  35. final def notify(): Unit
    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  37. def outPortEvent(portState: PortState): Unit

    The channel has just changed its state in a way that will affect outPortState

    The channel has just changed its state in a way that will affect outPortState

    Definition Classes
    Chan
  38. def outPortState: PortState

    Current state of this port: for alternation implementations

    Current state of this port: for alternation implementations

    Definition Classes
    N2NBufOutPort
  39. def readBefore(nsWait: basis.Nanoseconds): Option[T]

    Block until the earlier of the following events happens:

    Block until the earlier of the following events happens:

    - 1. A value, t, is available for input.

    - 2. ns nanoseconds have elapsed.

    Return Some(t) in case 1, and None in case 2.

    The longest possible wait that can specified this way is about 146 years.

    Definition Classes
    N2NBufInPort
  40. val reads: AtomicLong

    Count oof the number of finished reads (writes)

    Count oof the number of finished reads (writes)

    Definition Classes
    N2NBuf
  41. def register(): Unit

    Register this object

    Register this object

    Definition Classes
    Debuggable
  42. def setName(name: String): Unit

    Set the name using the name generator

    Set the name using the name generator

    Definition Classes
    Named
  43. def showState(out: PrintWriter): Unit

    Show the current state of this object: default uses toString

    Show the current state of this object: default uses toString

    Definition Classes
    N2NBufDebuggable
  44. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  45. def toString(): String
    Definition Classes
    N2NBufNamed → AnyRef → Any
  46. def unregister(): Unit

    Unregister this object

    Unregister this object

    Definition Classes
    Debuggable
  47. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. def withDebugger[T](condition: Boolean)(body: ⇒ T): T

    Conditionally register this object with the debugger only for the duration of the evaluation of body.

    Conditionally register this object with the debugger only for the duration of the evaluation of body. To be used as a last resort for the exasperated CSO toolkit debugger.

    Definition Classes
    Debuggable
  51. def withName(__name: String): Chan[T]

    Set the name of this object and return it

    Set the name of this object and return it

    Definition Classes
    Named
  52. def writeBefore(nsWait: Long)(value: T): Boolean

    Output value to the port's channel before nsWait has elapsed, and return true; or return false

    Output value to the port's channel before nsWait has elapsed, and return true; or return false

    Definition Classes
    N2NBufOutPort
  53. val writes: AtomicLong

    Count oof the number of finished reads (writes)

    Count oof the number of finished reads (writes)

    Definition Classes
    N2NBuf

Inherited from N2NBuf[T]

Inherited from SharedChan[T]

Inherited from SharedInPort[T]

Inherited from SharedOutPort[T]

Inherited from Chan[T]

Inherited from debug.REGISTRY.Debuggable

Inherited from Named[Chan[T]]

Inherited from OutPort[T]

Inherited from InPort[T]

Inherited from AnyRef

Inherited from Any

Ungrouped