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 process
    Definition Classes
    threadcso
  • CSOExecutor
  • CSOThreads
  • PROC
  • ParSyntax
  • PooledCSOExecutor
  • Process
  • SizePooledCSOExecutor
  • Stopped
  • ThreadPooledCSOExecutor

class ParSyntax extends PROC

Syntactic composition of PROCs.

Evaluating an expression of the form

p1 || p2 || ... || pn

yields a

ParSyntax(List(pn, ..., p1))

This is done because || is parsed left-associatively by Scala, and it's more efficient to cons its right argument to the the front of the accumulated list than it is to append it at the end.

The computation of its meaning is deferred until (the first time) it is run (by forking or applying).

At this point the process list is reversed and compiled just in time by being embedded in a Par. The reversal is not semantically necessary, but it helps to make a subsequent ParException more intelligible. More importantly, it is consistent with the way in which a prefix || constructs its Par.

Linear Supertypes
PROC, () ⇒ Unit, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ParSyntax
  2. PROC
  3. Function0
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ParSyntax(_procs: List[PROC])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val __name: String
    Attributes
    protected[io.threadcso]
    Definition Classes
    PROC
  5. val __stackSize: Long
    Attributes
    protected[io.threadcso]
    Definition Classes
    PROC
  6. def apply(): Unit

    Run the component processes; each in its own thread (the first process runs in the current thread.

    Run the component processes; each in its own thread (the first process runs in the current thread. Terminate when all processes have terminated: with or without throwing an exception.

    If all processes terminated without throwing an exception, then terminate cleanly.

    If all exceptions thrown are of the Stopped family, then a single Stopped exception is thrown on termination.

    Otherwise terminate by throwing a ParException that embeds the sequence of termination reasons of the component processes (with null for a clean termination).

    Definition Classes
    ParSyntaxPROC → Function0
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def fork: Handle

    Fork this process and return a handle on the thread in which it is running.

    Fork this process and return a handle on the thread in which it is running.

    Definition Classes
    ParSyntaxPROC
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def name: String
    Definition Classes
    ParSyntaxPROC
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  20. def stackSize: Long
    Definition Classes
    PROC
  21. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    PROC → Function0 → AnyRef → Any
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def withName(_name: String): PROC

    Set the name of this PROC and return this PROC.

    Set the name of this PROC and return this PROC.

    Definition Classes
    PROC
  27. def withStackSize(_stackSize: Long): PROC

    Set the (advisory) stack size for threads in which this PROC will run to stackSize, and return this PROC.

    Set the (advisory) stack size for threads in which this PROC will run to stackSize, and return this PROC. Some JVMs allow threads to be started with a given stack size.

    Definition Classes
    PROC
  28. def ||(other: PROC): PROC

    Construct the parallel composition of this and other

    Construct the parallel composition of this and other

    Definition Classes
    ParSyntaxPROC
  29. def ||(other: ParSyntax): PROC

    Construct the parallel composition of this and other

Inherited from PROC

Inherited from () ⇒ Unit

Inherited from AnyRef

Inherited from Any

Ungrouped