コード例 #1
0
ファイル: Form1.cs プロジェクト: Daniel-Orozco/os_sim
        public void terminateProcess(Process t_process)
        {
            t_process.finishing_cycle = clock_value;
            t_process.time_in_system = t_process.finishing_cycle - t_process.arrival_cycle;
            t_process.idle_time = t_process.time_in_system - t_process.total_io1 - t_process.total_cpu;
            t_process.status = "Killed";

            updatePCB(t_process, t_process.getID());

            last_finished = t_process.id;

            Finished.addProcess(t_process);
            finished_list.Text += t_process.getID() + "\r\n";
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Daniel-Orozco/os_sim
        public void generateProcess()
        {
            Process n_process;
            if(rand.Next(0,100) < chance)
            {
                //public Process(int next_id, int cycle, int avrg, Random rand, int q, int iouse, int iochance, int frame_size)
                n_process = new Process(last_processid + 1, clock_value, average_cycles, rand, tquantum, io1_usage, io1_chance, frame_s);
                last_processid++;
                New.addProcess(n_process);

                new_list.AppendText(n_process.getID() + "\r\n");
                updatePCB(n_process, n_process.getID());
            }
        }