Trying out how to fix the sjf errors.

This commit is contained in:
Charles Descamps 2024-04-08 13:36:29 -07:00
parent 022ca3ac06
commit e3441e9fbd
3 changed files with 4 additions and 9 deletions

View file

@ -1,7 +0,0 @@
0.000000, OS: Simulator start
READY state from NEW state
ate
ate

Binary file not shown.

View file

@ -865,6 +865,9 @@ int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPt
char timeStringy[MAX_STR_LEN]; char timeStringy[MAX_STR_LEN];
int processCount = 0; int processCount = 0;
int shortestJob = 0;
int shortestJobProcNum = 0;
while (wkgPtr != NULL) while (wkgPtr != NULL)
{ {
if(wkgPtr->process_state != PROCESS_STATE_TERMINATED) if(wkgPtr->process_state != PROCESS_STATE_TERMINATED)
@ -928,8 +931,7 @@ int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPt
// need to find shortest job, maybe using a find min function? // need to find shortest job, maybe using a find min function?
// reuse the previous code to set each process to READY from NEW // reuse the previous code to set each process to READY from NEW
// will select the process that is in the READY state, with the shortest time. // will select the process that is in the READY state, with the shortest time.
int shortestJob = 0;
int shortestJobProcNum = 0;
while (wkgPtr != NULL) while (wkgPtr != NULL)
{ {
// //