C# Класс 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.
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Описание методов

assignJob() публичный статический Метод

Assigns job to all existing workers.
public static assignJob ( IJob job ) : void
job IJob
Результат void

getWorkerCount() публичный статический Метод

Returns the number of existing workers.
public static getWorkerCount ( ) : int
Результат int

initializeWorkers() публичный статический Метод

Creates workerCount many workers. Can only be called once.
public static initializeWorkers ( int workerCount ) : void
workerCount int The number of workers to create.
Результат void

wait() публичный статический Метод

Waits, until all workers are finished with their current jobs.
public static wait ( ) : void
Результат void