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.
Afficher le fichier Open project: denniskb/asvo

Méthodes publiques

Méthode 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 méthode

Assigns job to all existing workers.
public static assignJob ( IJob job ) : void
job IJob
Résultat void

getWorkerCount() public static méthode

Returns the number of existing workers.
public static getWorkerCount ( ) : int
Résultat int

initializeWorkers() public static méthode

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

wait() public static méthode

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