Exemple #1
0
        public void Deinterrupt()
        {
            var p = Blocked.Dequeue();

            p.State = States.Ready;

            Ready.Enqueue(p);
            memory.ChangeFramesState(p, States.Ready); // <<
        }
Exemple #2
0
        public void Admit()
        {
            while (New.Count > 0 && memory.FreeFrames > 0 && New.Peek().TotalPages <= memory.FreeFrames)
            {
                Process p = New.Dequeue();

                p.tEsp  = 0;
                p.tTra  = 0;
                p.tLle  = GlobalTime;
                p.State = States.Ready;

                Ready.Enqueue(p);
                memory.InsertProcess(p, States.Ready);

                mW.tblReady.Rows.Add(p.Id, p.TME, p.tRst);
            }
        }
Exemple #3
0
        public void Terminate()
        {
            if (wasInterru == false && Running.tTra < Running.TME)
            {
                Ready.Enqueue(Running);
                memory.ChangeFramesState(Running, States.Ready); // <<

                mW.tblReady.Rows.Add(Running.Id, Running.TME, Running.tRst);
            }
            else
            {
                Running.tFin  = GlobalTime;
                Running.tRet  = Running.tEsp + Running.tTra;
                Running.State = States.Terminated;
                Exit.Enqueue(Running);

                memory.FreeFrames += Running.TotalPages;
                memory.ChangeFramesState(Running, States.New); // <<

                // --------- WINDOW ----------- //
                mW.tblTerminated.Rows.Add(Running.Id, Running.Ope.ToString(), Running.Ope.Result);
            }
        }