C# Class multithreading.JobCenter

Represents a job center that creates and manages workers and assignes jobs to them. Not thread-safe!, should only be used from a single thread environment.
显示文件 Open project: denniskb/asvo

Public Methods

Method Description
assignJob ( IJob job ) : void

Assigns job to all existing workers.

getWorkerCount ( ) : int

Returns the number of existing workers.

initializeWorkers ( int workerCount ) : void

Creates workerCount many workers. Can only be called once.

wait ( ) : void

Waits, until all workers are finished with their current jobs.

Method Details

assignJob() public static method

Assigns job to all existing workers.
public static assignJob ( IJob job ) : void
job IJob
return void

getWorkerCount() public static method

Returns the number of existing workers.
public static getWorkerCount ( ) : int
return int

initializeWorkers() public static method

Creates workerCount many workers. Can only be called once.
public static initializeWorkers ( int workerCount ) : void
workerCount int The number of workers to create.
return void

wait() public static method

Waits, until all workers are finished with their current jobs.
public static wait ( ) : void
return void