diff --git a/Documents/manual.adoc b/Documents/manual.adoc index a45534c..07730a9 100644 --- a/Documents/manual.adoc +++ b/Documents/manual.adoc @@ -99,6 +99,10 @@ Current_Thread must be defined by the derived class as it returns the identity o The implementations of the operations Identity and Self are provided by the base class because some threads packages do not provide similar functionality: Identity returns the unique identity of the thread associated with the given objects, and Self returns the currently executing thread. Because Self is a _static_ member function it can be invoked without creating an instance of the Thread class, i.e., using Thread::Self(). +Typically when building your simulation you will have a single process which coordinates the other entities. This coordinator will be its own simulation entity that is created by the main (process) thread, which itself must be suspended while the simulation executes. This means that when the simulation wants to end, the main thread must be resumed. The mainResume() method should be called by your coordinator entity to have this happen. + +If during the execution of your simulation you ever need to exit the entire process, use the exit() method and you can pass a specific return code. + === Specific Thread Class Implementations Over the years we have supported a wide variety of thread packages, ranging from those available in various Unix implementations such as Solaris, through Posix compliant thread packages and to Windows threads. However, currently we can only test on Linux so that is the only implementation we support. diff --git a/Manual/man/man3/Thread.3A b/Manual/man/man3/Thread.3A index ef4363c..d233127 100644 --- a/Manual/man/man3/Thread.3A +++ b/Manual/man/man3/Thread.3A @@ -18,7 +18,7 @@ Thread \- runtime thread implementation .br .BI " virtual void Resume ();" .br -.BI " virtual void Body ();" +.BI " virtual void Body () = 0;" .sp .BI " virtual long Current_Thread () const;" .sp @@ -26,6 +26,10 @@ Thread \- runtime thread implementation .sp .BI " static Thread *Self ();" .sp +.BI " statid void Exit (int = 0); +.sp +.BI " static void mainResume ();" +.sp .BI "protected:" .br .BI " Thread ();" @@ -70,6 +74,16 @@ to. Self returns a pointer to the currently active thread object. +Typically when building your simulation you will have a single process which coordinates the other entities. This coordinator will be its own simulation entity that is created by the main (process) thread, which itself must be suspended while the simulation executes. This means that when the simulation wants to end, the main thread must be resumed. The +.B +mainResume +method should be called by your coordinator entity to have this happen. + +If during the execution of your simulation you ever need to exit the entire process, use the +.B +exit +method and you can pass a specific return code. + .B thread_key is used to uniquely identify each threaded object within