コード例 #1
0
        public ThreadJobPair(ComputationCore <Creature> computationCore)
        {
            ComputationCore = computationCore;

            Thread = new Thread(ComputationCore.Run);
            Thread.Start();
        }
コード例 #2
0
        private void CreateComputationCores(Creature foreFather)
        {
            activeJobs = new List <ThreadJobPair <Creature> >();

            for (int i = 0; i < myEnvironment.MaximalNumOfRunningThreads; i++)
            {
                ComputationCore <Creature> core = new ComputationCore <Creature>(myEnvironment, startPool, foreFather);
                core.WorkHasBeenDoneDelegate = SourseDriedOutHandler;

                ThreadJobPair <Creature> threadJob = new ThreadJobPair <Creature>(core);
                activeJobs.Add(threadJob);
            }
        }