Skip to content

Commit

Permalink
Dimuinuindo a prioridade do processo após executá-lo
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavooquinteiro committed Jun 9, 2019
1 parent fc7d5db commit 1449ccd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def runClock(self):

if self.state != CPU.State[3]:
self.execute()
self.process.priority /= 2
if self.quantum - self.processing_time == 0:
self.state = CPU.State[5]

Expand Down Expand Up @@ -154,4 +155,4 @@ def execute(self):
self.processing_time += 1
#time.sleep(self.processing_time)
#print ("CPU executou {} que precisa de {}s por {}s" .format(self.process.id, self.process.execution_time, self.processing_time))
self.process.execution_time -= 1
self.process.execution_time -= 1

0 comments on commit 1449ccd

Please sign in to comment.