Answered step by step
Verified Expert Solution
Question
1 Approved Answer
void finalize _ stats ( SCHEDULER _ STATS * stats ) { / / todo } void mark _ process _ start ( SCHEDULER _
void finalizestatsSCHEDULERSTATS stats
todo
void markprocessstartSCHEDULERSTATS stats, PROCESS p float currtime, float timeslice
todo
void markprocessrunSCHEDULERSTATS stats, PROCESS p float currtime, float timeslice
todo
void markprocessendSCHEDULERSTATS stats, PROCESS p float endtime, float timesliceremaining
todo
Complete the avove todo's which are functions in c
Write the code for that.
Write the code such that It passes thee test case.
I am giving you test cases for these functions.
#include
#include srcstudentcode.h
#include srcprocessh
#include srcprocesslist.h
#include srcprocessscheduling.h
TestHelperFunctions markprocessstart, disabledfalse
SCHEDULERSTATS s getemptystatsblock;
PROCESS p createprocessff;
markprocessstarts pff;
crassertplength f;
crassertppriority ;
crassertpentrytime f;
crassertptimeremaining f;
crassertsnumprocessesstarted ;
crassertsnumprocessescompleted ;
crassertssumofturnaroundtimes f;
crassertssumofresponsetime f;
crassertsaverageturnaroundtime f;
crassertsaverageresponsetime f;
crassertscompletiontime f;
TestHelperFunctions markprocessrun, disabledfalse
SCHEDULERSTATS s getemptystatsblock;
PROCESS p createprocessff;
markprocessruns pff;
crassertplength f;
crassertppriority ;
crassertpentrytime f;
crassertptimeremaining f;
crassertsnumprocessesstarted ;
crassertsnumprocessescompleted ;
crassertssumofturnaroundtimes f;
crassertssumofresponsetime f;
crassertsaverageturnaroundtime f;
crassertsaverageresponsetime f;
crassertscompletiontime f;
TestHelperFunctions markprocessend, disabledfalse
SCHEDULERSTATS s getemptystatsblock;
PROCESS p createprocessff;
ptimeremaining ; Pretend the job ran
markprocessends pff;
crassertplength f;
crassertppriority ;
crassertpentrytime f;
crassertptimeremaining f;
crassertsnumprocessesstarted ;
crassertsnumprocessescompleted ;
crassertssumofturnaroundtimes f;
crassertssumofresponsetime f;
crassertsaverageturnaroundtime f;
crassertsaverageresponsetime f;
crassertscompletiontime f;
TestHelperFunctions finalizestats, disabledfalse
SCHEDULERSTATS s getemptystatsblock;
PROCESS p createprocessff;
PROCESS p createprocessff;
markprocessstarts pff;
markprocessruns pff;
markprocessends pff;
markprocessstarts pff;
markprocessruns pff;
markprocessends pff;
finalizestatss;
crassertsnumprocessesstarted ;
crassertsnumprocessescompleted ;
crassertssumofturnaroundtimes f;
crassertssumofresponsetime f;
crassertsaverageturnaroundtime f;
crassertsaverageresponsetime f;
crassertscompletiontime f;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started