public ResourceRecord(Process process, IoBurstDescriptor burst)
 {
     this.process = process;
     this.burst = burst;
 }
Пример #2
0
        public void resourceStep(IoBurstDescriptor ioBurst)
        {
            ioBurst.BurstTime -= 1;
            if (ioBurst.GetType() == typeof(IoBurstSynchronousDescriptor))
            {
                SynchronousTimeRunned += 1;
                SynchronousTimeLeft -= 1;
            }
            if (ioBurst.GetType() == typeof(IoBurstAsynchronousDescriptor))
            {
                AsynchronousTimeRunned += 1;
                AsynchronousTimeLeft -= 1;
            }

            if (ioBurst.BurstTime == 0)
            {
                BurstSequence.Remove(ioBurst);                                        // csak TESZT miatt (hogy látható legyen a blokkolás), élesnél vissza
                if (ioBurst.GetType() == typeof(IoBurstSynchronousDescriptor))
                {
                    ProcessStatus = ProcessStatusEnum.Ready;
                }
            }
            if (BurstSequence.Count == 0)
            {
                ProcessStatus = ProcessStatusEnum.Finished;
            }
        }