Пример #1
0
 private static void PopulateWorkers(ResourceWorkerManager resourceWorkerManager)
 {
     Parallel.For(0, NUM_OF_WORKERS, (i) =>
     {
         resourceWorkerManager.AddWorker(i, randomTime(1000));
     });
 }
Пример #2
0
        static void Main(string[] args)
        {
            // create & populate resource workers collection object
            ResourceWorkerManager resourceWorkerManager = new ResourceWorkerManager(NUM_OF_WORKERS);

            PopulateWorkers(resourceWorkerManager);

            // start user control interface
            Task.Run(() => UserActions());

            // start the job execution task
            resourceWorkerManager.ExecuteJobs();
        }