Пример #1
0
        public Thread(int TID, int PID, int ExecutionTime, FormPlanner formPlanner)
        {
            this.TID = TID;
            this.PID = PID;
            this.ThreadExecutionTime = ExecutionTime;
            this.formPlanner         = formPlanner;

            OneIteration = ThreadExecutionTime / rnd.Next(10, 18);
        }
Пример #2
0
        public Process(int Pid, int ThreadCount, FormPlanner form)
        {
            PID                  = Pid;
            Threads              = new List <Thread>();
            formPlanner          = form;
            Threads              = new List <Thread>();
            ProcessExecutionTime = 300;
            int tmp = 0;

            for (int i = 0; i < ThreadCount - 1; ++i)
            {
                int time = ProcessExecutionTime / ThreadCount;
                ExecutionTimeForThread.Add(time);
                tmp += time;
            }
            ExecutionTimeForThread.Add(ProcessExecutionTime - tmp);

            for (int i = 0; i < ThreadCount; ++i)
            {
                Threads.Add(new Thread(i, PID, ExecutionTimeForThread[i], formPlanner));
            }
        }
Пример #3
0
 public Core(FormPlanner formPlanner)
 {
     this.formPlanner = formPlanner;
     processes        = new List <Process>();
 }