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 channel

    This package defines channels that can participate in the CSO alternation constructs.

    This package defines channels that can participate in the CSO alternation constructs.

    I have separated syntax and semantics as far as was practical, given my reluctance to get embroiled with the Scala macro system (it was unstable when the CSO work started)

    An io.threadcso.alternation.Run embodies the state of execution of an alternation.

    The guarded event notation: (guard && port) =...=> { .... } is parsed to a Guarded...Port =...=> ... then to an appropriate class of event. The former is achieved by defining the implicit class io.threadcso.Guarded in the top-level CSO API. This provides the appropriate extension to Boolean.

    @author Bernard Sufrin, Oxford
    $Revision: 240 $
    $Date: 2017-10-13 18:12:11 +0100 (Fri, 13 Oct 2017) $
    Definition Classes
    alternation
  • AltCapableChannel
  • Chan
  • GuardedChan
  • GuardedInPort
  • GuardedOutPort
  • InPort
  • N2N
  • N2NBuf
  • OneOne
  • OneOneBuf
  • OutPort
  • SharedAltCapableChannel

class N2N[T] extends channel.N2N[T] with SharedAltCapableChannel[T]

A version of its namesake from io.threadcso.channel with the capacity to participate in alt and serve commands

See also

io.threadcso.channel.N2N

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. N2N
  2. SharedAltCapableChannel
  3. AltCapableChannel
  4. Chan
  5. OutPort
  6. InPort
  7. N2N
  8. SharedChan
  9. SharedInPort
  10. SharedOutPort
  11. OneOne
  12. SyncChan
  13. Chan
  14. Debuggable
  15. Named
  16. OutPort
  17. InPort
  18. AnyRef
  19. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new N2N(writers: Int, readers: Int, name: String = null, fairOut: Boolean = false, fairIn: Boolean = false)

Value Members

  1. def !(value: T): Unit

    Output value to the port's channel.

    Output value to the port's channel.

    Definition Classes
    N2NOneOneOutPort
  2. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  3. final def ##(): Int
    Definition Classes
    AnyRef → Any
  4. def =!=>(gen: ⇒ T): OutPortEvent[T]

    Construct an unconditional output event for use in an alternation.

    Construct an unconditional output event for use in an alternation.

    Definition Classes
    ChanOutPort
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def =?=>(body: (T) ⇒ Unit): InPortEvent[T]

    Construct an unconditional input event for use in an alternation.

    Construct an unconditional input event for use in an alternation.

    Definition Classes
    ChanInPort
  7. def =??=>(body: (T) ⇒ Unit): InPortEventExtended[T]

    Construct an unconditional extended-rendezvous input event for use in an alternation.

    Construct an unconditional extended-rendezvous input event for use in an alternation.

    Definition Classes
    ChanInPort
  8. def ?[U](f: (T) ⇒ U): U

    Ordinary rendezvous read & sync then compute

    Ordinary rendezvous read & sync then compute

    Definition Classes
    N2NOneOneInPort
  9. 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
    N2NOneOneInPort
  10. def ??[U](f: (T) ⇒ U): U

    Extended rendezvous read & compute, then sync

    Extended rendezvous read & compute, then sync

    Definition Classes
    N2NOneOneInPort
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. 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
    OneOneInPort
  13. 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
    OneOneOutPort
  14. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. def close(): Unit

    Signal that the channel is to be closed forthwith

    Signal that the channel is to be closed forthwith

    Definition Classes
    OneOneChan
  16. 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
    N2NOneOneInPort
  17. 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
    N2NOneOneOutPort
  18. def currentState: String

    Capture (an approximation to) the current state for debugger components

    Capture (an approximation to) the current state for debugger components

    Definition Classes
    OneOne
  19. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  21. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def finishedRW: String

    Intelligible information about finished reads and writes

    Intelligible information about finished reads and writes

    Definition Classes
    OneOne
    Annotations
    @elidable( FINEST )
  23. def finishedRead: Long

    Increment count of finished reads

    Increment count of finished reads

    Definition Classes
    OneOne
    Annotations
    @elidable( FINEST )
  24. def finishedWrite: Long

    Increment count of finished writes

    Increment count of finished writes

    Definition Classes
    OneOne
    Annotations
    @elidable( FINEST )
  25. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  26. def getWaiting: Seq[Thread]

    Return an approximation to the set of threads waiting for this channel.

    Return an approximation to the set of threads waiting for this channel. Intended to be invoked (from the debugger) only when system is quiescing or deadlocked.

    Definition Classes
    N2NDebuggable
  27. 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
  28. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  29. val inPort: InPort[T]

    this as an InPort

    this as an InPort

    Definition Classes
    Chan
  30. 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
    N2NChan
  31. def inPortState: PortState

    READY if not closed and there's a writer waiting to sync (else CLOSED or UNKNOWN) (used only by alternation implementations)

    READY if not closed and there's a writer waiting to sync (else CLOSED or UNKNOWN) (used only by alternation implementations)

    Definition Classes
    OneOneInPort
  32. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  33. 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
  34. def logLastInState(state: PortState): Unit

    For detailed logging

    For detailed logging

    Definition Classes
    AltCapableChannel
    Annotations
    @inline() @elidable( FINEST )
  35. def logLastOutState(state: PortState): Unit

    For detailed logging

    For detailed logging

    Definition Classes
    AltCapableChannel
    Annotations
    @inline() @elidable( FINEST )
  36. def logLastReg(port: String, unreg: Boolean, state: PortState): Unit

    For detailed logging

    For detailed logging

    Definition Classes
    AltCapableChannel
    Annotations
    @inline() @elidable( FINEST )
  37. def name: String

    Return the name of the object

    Return the name of the object

    Definition Classes
    Named
  38. def nameGenerator: NameGenerator

    Discover the name generator

    Discover the name generator

    Definition Classes
    N2NOneOneNamed
  39. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. 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()
  41. final def notify(): Unit
    Definition Classes
    AnyRef
  42. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  43. val outPort: OutPort[T]

    this as an OutPort

    this as an OutPort

    Definition Classes
    Chan
  44. 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
    N2NChan
  45. def outPortState: PortState

    READY if not closed and there's a reader waiting and last writer has already synced (else CLOSED or UNKNOWN) (used only by alternation implementations)

    READY if not closed and there's a reader waiting and last writer has already synced (else CLOSED or UNKNOWN) (used only by alternation implementations)

    Definition Classes
    OneOneOutPort
  46. def readBefore(nsWait: Long): 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
    N2NOneOneInPort
  47. val reads: AtomicLong

    Count of the number of finished reads (writes)

    Count of the number of finished reads (writes)

    Definition Classes
    OneOne
  48. def register(): Unit

    Register this object

    Register this object

    Definition Classes
    Debuggable
  49. def registerIn(alt: Runnable, index: Int): PortState

    Register an input event with this channel, and return the port state

    Register an input event with this channel, and return the port state

    Definition Classes
    AltCapableChannelInPort
  50. def registerOut(alt: Runnable, index: Int): PortState

    Register an output event with this channel, and return the port state

    Register an output event with this channel, and return the port state

    Definition Classes
    AltCapableChannelOutPort
  51. def setInPortStateImp(portState: PortState): Unit

    Standard implementation of setInPortState for alt-able channel

    Standard implementation of setInPortState for alt-able channel

    Attributes
    protected
    Definition Classes
    AltCapableChannel
    Annotations
    @inline()
  52. def setName(name: String): Unit

    Set the name using the name generator

    Set the name using the name generator

    Definition Classes
    Named
  53. def setOutPortStateImp(portState: PortState): Unit

    Standard implementation of setOutPortState for alt-able channel

    Standard implementation of setOutPortState for alt-able channel

    Attributes
    protected
    Definition Classes
    AltCapableChannel
    Annotations
    @inline()
  54. def showState(out: PrintWriter): Unit

    For use by the debugger

    For use by the debugger

    Definition Classes
    AltCapableChannelDebuggable
  55. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  56. val theIndex: Int

    Index of this channel in the currently-registered running alternation

    Index of this channel in the currently-registered running alternation

    Attributes
    protected[this]
    Definition Classes
    AltCapableChannel
  57. def toString(): String
    Definition Classes
    OneOneNamed → AnyRef → Any
  58. def unregister(): Unit

    Unregister this object

    Unregister this object

    Definition Classes
    Debuggable
  59. def unregisterIn(): PortState

    Unregister an input event with this channel, and return the port state

    Unregister an input event with this channel, and return the port state

    Definition Classes
    AltCapableChannelInPort
  60. def unregisterOut(): PortState

    Unregister an output event with this channel, and return the port state

    Unregister an output event with this channel, and return the port state

    Definition Classes
    AltCapableChannelOutPort
  61. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. 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
  65. def withName(__name: String): channel.Chan[T]

    Set the name of this object and return it

    Set the name of this object and return it

    Definition Classes
    Named
  66. 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
    N2NOneOneOutPort
  67. val writes: AtomicLong

    Count of the number of finished reads (writes)

    Count of the number of finished reads (writes)

    Definition Classes
    OneOne

Inherited from SharedAltCapableChannel[T]

Inherited from AltCapableChannel[T]

Inherited from Chan[T]

Inherited from OutPort[T]

Inherited from InPort[T]

Inherited from channel.N2N[T]

Inherited from SharedChan[T]

Inherited from SharedInPort[T]

Inherited from SharedOutPort[T]

Inherited from channel.OneOne[T]

Inherited from SyncChan[T]

Inherited from channel.Chan[T]

Inherited from debug.REGISTRY.Debuggable

Inherited from Named[channel.Chan[T]]

Inherited from channel.OutPort[T]

Inherited from channel.InPort[T]

Inherited from AnyRef

Inherited from Any

Ungrouped