- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
RTS_MAIN_PROGRAM
link class process; begin ref (EVENT_NOTICE) EVENT; Boolean TERMINATED; Boolean procedure idle; idle := EVENT==none; Boolean procedure terminated; terminated := TERMINATED; long real procedure evtime; if idle then error("..." ! No Evtime for idle process) else evtime := EVENT.EVTIME; ref (process) procedure nextev; nextev :- if idle or else EVENT.suc == none then none else EVENT.suc.PROC; detach; inner; TERMINATED:= true; passivate; error("..." ! Terminated process;) end process;An object of a class prefixed by "process" is called a process object. A process object has the properties of "link" and, in addition, the capability to be represented in the sequencing set and to be manipulated by certain sequencing statements which may modify its "process state". The possible process states are: active, suspended, passive and terminated.
When a process object is generated it immediately becomes detached and its reactivation point positioned in front of the first statement of its user- defined operation rule. The process object remains detached throughout its dynamic scope.
The procedure "idle" has the value true if the process object is not currently represented in the sequencing set. It is said to be in the passive or terminated state depending on the value of the procedure "terminated". An idle process object is passive if its reactivation point is at a user-defined prefix level. If and when the PSC passes through the final end of the user-defined part of the body, it proceeds to the final operations at the prefix level of the class "process", and the value of the procedure "terminated" becomes true. (Although the process state "terminated" is not strictly equivalent to the corresponding basic concept defined in chapter 7, an implementation may treat a terminated process object as terminated in the strict sense). A process object currently represented in the sequencing set is said to be "suspended", unless it is represented by the event notice at the lower end of the sequencing set. In the latter case it is active. A suspended process is scheduled to become active at the system time indicated by the attribute EVTIME of its event notice. This time value may be accessed through the procedure "evtime". The procedure "nextev" references the process object, if any, represented by the next event notice in the sequencing set.
Link to GitHub: Source File.
- Author:
- SIMULA Standards Group, Øystein Myhre Andersen
-
Nested Class Summary
Nested classes/interfaces inherited from class simula.runtime.RTS_RTObject
RTS_RTObject.ForElt, RTS_RTObject.ForList, RTS_RTObject.ForListIterator, RTS_RTObject.OperationalState, RTS_RTObject.RTS_BOOLEAN_ARRAY, RTS_RTObject.RTS_BOUNDS, RTS_RTObject.RTS_CHARACTER_ARRAY, RTS_RTObject.RTS_INTEGER_ARRAY, RTS_RTObject.RTS_LABEL, RTS_RTObject.RTS_LONG_REAL_ARRAY, RTS_RTObject.RTS_NAME<T>, RTS_RTObject.RTS_REAL_ARRAY, RTS_RTObject.RTS_REALTYPE_ARRAY, RTS_RTObject.RTS_REF_ARRAY<T>, RTS_RTObject.RTS_TEXT_ARRAY, RTS_RTObject.SingleElt<T>, RTS_RTObject.SingleTValElt, RTS_RTObject.StepUntil, RTS_RTObject.UncaughtExceptionHandler, RTS_RTObject.WhileElt<T>, RTS_RTObject.WhileTValElt
-
Field Summary
Modifier and TypeFieldDescription(package private) RTS_EVENT_NOTICE
The corresponding EVENT to this Process.Fields inherited from class simula.runtime.RTS_Linkage
PRED, SUC
Fields inherited from class simula.runtime.RTS_ENVIRONMENT
_STARTTIME, CURRENTDECIMALMARK, CURRENTLOWTEN, EXCEPTION_HANDLER, maxint, maxlongreal, maxreal, minint, minlongreal, minreal, simulaReleaseID
Fields inherited from class simula.runtime.RTS_RTObject
_CORUT, _CTX, _CUR, _DL, _INPUT_LINELENGTH, _JTX, _OUTPUT_LINELENGTH, _SL, _STATE, _SYSIN, _SYSOUT, NOTEXT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_STM()
Method representing the Statements in this Block
This method is virtual and must be redefined in blocks.double
evtime()
Returns the event time.boolean
idle()
Returns true if this process is scheduled (in SQS)boolean
This is a static property generated by the compiler.nextev()
Returns the next process in SQS.protected void
Utility: Terminate this Process.boolean
Procedure terminated.toString()
Returns a string representation of the object.Methods inherited from class simula.runtime.RTS_Linkage
pred, prev, suc
Methods inherited from class simula.runtime.RTS_ENVIRONMENT
_char, _IPOW, _IS, abs, abs, abs, addepsilon, addepsilon, arccos, arcsin, arctan, arctan2, Char, clocktime, cos, cosh, cotan, cputime, datetime, decimalmark, DEFEXCEPTION, digit, discrete, draw, edfix, edit, edit, edit, edit, edit, edtime, entier, Erlang, error, exp, getIntInfo, getTextInfo, giveIntInfo, giveTextInfo, hash, histd, histo, isochar, isorank, letter, linear, ln, loadChar, log10, lowcase, lowerbound, lowten, max, max, max, max, max, min, min, min, min, min, mod, negexp, normal, Poisson, printStaticChain, printThreadList, randint, rank, rem, rts_utility, sign, simulaid, sin, sinh, sqrt, storeChar, subepsilon, subepsilon, tan, tanh, uniform, upcase, upperbound, waitSomeTime
Methods inherited from class simula.runtime.RTS_RTObject
_ASGSTR, _ASGTXT, _GOTO, _JUMPTABLE, _JUMPTABLE, _LABEL, _PRE_LABEL, _PRE_TABLE, _SIM_LABEL, _TXTREL_EQ, _TXTREL_GE, _TXTREL_GT, _TXTREL_LE, _TXTREL_LT, _TXTREL_NE, _VALUE, arrayValue, BBLK, blanks, BPRG, call, call, CONC, copy, detach, detach, detach, doubleValue, EBLK, edObjectAttributes, edObjectIdent, floatValue, getErrorMessage, intValue, isQPSystemBlock, objectTraceIdentifier, objectTraceIdentifier, objectValue, procValue, resume, resume, resume, swapCoroutines, sysin, sysout, terminate_program, TRACE_GOTO, TRF_EQ, TRF_NE
-
Field Details
-
EVENT
RTS_EVENT_NOTICE EVENTThe corresponding EVENT to this Process.
-
-
Constructor Details
-
RTS_Process
Create a new _Process.- Parameters:
SL
- staticLink
-
-
Method Details
-
isDetachUsed
public boolean isDetachUsed()Description copied from class:RTS_RTObject
This is a static property generated by the compiler.
It will return true for Blocks in which 'detach' is used.
This method is redefined in every subclass which represent a Simula Block.- Overrides:
isDetachUsed
in classRTS_RTObject
- Returns:
- true: this object is a QPS System block
-
_STM
Description copied from class:RTS_RTObject
Method representing the Statements in this Block
This method is virtual and must be redefined in blocks. -
terminate
protected void terminate()Utility: Terminate this Process. -
idle
public boolean idle()Returns true if this process is scheduled (in SQS)- Returns:
- true if this process is scheduled, otherwise false
-
terminated
public boolean terminated()Procedure terminated.- Returns:
- true if this process is terminated
-
evtime
public double evtime()Returns the event time.- Returns:
- the event time
- Throws:
RTS_SimulaRuntimeError
- if this process is idle
-
nextev
Returns the next process in SQS.- Returns:
- the next process in SQS
-
toString
Description copied from class:RTS_RTObject
Returns a string representation of the object.- Overrides:
toString
in classRTS_BASICIO
-