IGLib
1.5
The IGLib base library for development of numerical, technical and business applications.
|
Parallel job server for job containers that inherit from ParallelJobContainerGen. More...
Public Member Functions | |
ParallelJobServerGen () | |
![]() | |
ParallelJobServerGen () | |
![]() | |
ParallelJobServerBase () | |
void | NotifyJobStarted () |
Notifies all interested objects that the job has started. More... | |
void | NotifyJobFinished () |
Notifies all interested objects that the job has finished. More... | |
void | NotifyJobAborted () |
Notifies all interested parties that job has been aborted. More... | |
void | NotifyServerIdle (ParallelJobDispatcherBase< JobContainerType > dispatcher) |
Sets the Idle flag to true and notifies the containing dispatcher that the current server object has became idle. More... | |
void | StopServerThread () |
Sends to the server thread command that it has to stop. More... | |
void | KillServerThread () |
Forces the working to stop, even if it is in the middle of eecution of a job, by aborting the thread. To let the working thread finish its current jobs and then stop, call StopServerThread More... | |
void | StartServer () |
void | StartJobByServer () |
Starts job by the server. More... | |
void | StartSingleJob () |
Starts a single job in a new therad taht is created for this purpose. More... | |
void | RunJobSynchronous (JobContainerType jobData) |
void | StartJob (JobContainerType jobData) |
Starts the current job in the way specified by internal flags. More... | |
override string | ToString () |
Returns a string representation of the current job server, which contains relevent data about the server state. More... | |
Additional Inherited Members | |
![]() | |
override void | RunJobDefined (JobContainerType jobData) |
Runs the job whose data is contained in the specified job data container. More... | |
![]() | |
void | NotifyServerAboutJob () |
void | Serve () |
void | RunSingleJobInThread () |
Methods that runs the job on the serving thread, for the case when a new thread is allocated for each job (single job per thread). More... | |
void | RunJobInThread () |
Methods that runs the job on the serving thread, for the case when server thread executes multiple jobs (server mode). More... | |
![]() | |
static int | GetNextId () |
Returns another ID that is unique for objects of the containing class its and derived classes. More... | |
![]() | |
volatile bool | _isTestMode = ParallelJobContainerBase.DefaultIsTestMode |
int | _sleepTimeMs = DefaultSleepTimeMs |
ParallelJobDispatcherBase < JobContainerType > | _dispatcher |
ParallelServerState | _state = ParallelServerState.Idle |
JobContainerType | _jobData |
bool | _isServer = false |
bool | _commandStopServing = false |
ThreadPriority | _threadPriority = UtilSystem.ThreadPriority |
Thread | _workingThread |
bool | _isServerRunning = false |
![]() | |
object | Lock [get] |
This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More... | |
static int | DefaultOutputLevel [get, set] |
Default output level for objects of this and derived types. More... | |
int | OutputLevel [get, set] |
Output level the current object. More... | |
static bool | DefaultIsTestMode [get, set] |
Default value of test mode flag. More... | |
bool | IsTestMode [get, set] |
Whether the current job data conntainer is in test mode. In this mode, delays specified by internal variables are automatically added in job execution. More... | |
int | Id [get] |
Unique ID for objects of the currnet and derived classes. More... | |
static int | DefaultSleepTimeMs [get, set] |
Default sleeping time, in milliseconds, used by parallel job data objects when waiting for fulfillment of some condition in a loop that includes sleeping when condition is not met. More... | |
int | SleepTimeMs [get, set] |
Sleeping time, in milliseconds, used by the current object when waiting for fulfillment of some condition in a loop that includes sleeping when condition is not met. More... | |
ParallelJobDispatcherBase < JobContainerType > | Dispatcher [get, set] |
ParallelServerState | State [get, protected set] |
Gets the state of the current job runner. More... | |
bool | IsIdle [get] |
Gets a flag indicating whether the current job runner is idle. More... | |
bool | IsActive [get] |
JobContainerType | JobData [get, set] |
Data for the job that is executed by teh current parallel job runner. More... | |
bool | IsServer [get, set] |
Indicating whether the current job runner work as server. <par>If true then a server is started in a parallel thread that continuously for signals to start jobs.</par> More... | |
bool | CommandStopServing [get, protected set] |
Flag indicating whether the server should be stopped. If set to true and server thread is runing, then the server thread stops when the currently run job completes (or stops immediately if there is no job running). More... | |
ThreadPriority | ThreadPriority [get, set] |
Priority of the server thread. More... | |
bool | IsServerRunning [get] |
Indicates whether the server is currently running or not. More... | |
bool | DoRunJobByServer [get, protected set] |
![]() | |
object | Lock [get] |
![]() | |
int | Id [get] |
Returns unique ID (in the scope of a given type) of the current object. More... | |
Parallel job server for job containers that inherit from ParallelJobContainerGen.
InputType | Type of inpout data for jobs. |
ResultType | Type of output data for jobs. |
|
inline |