SlideShare a Scribd company logo
1 of 23
Instruction:
1. Please read the two articles. (Kincheloe part 1 & 2)
2. Please choose some of the topics covered in each chapter,
provide a brief summary (2-3 sentences) of those topics.
3. Then add your reflections, insights, or relevant experiences,
etc. to help illustrate or expand upon the course.
4. This journal should be at least 400 words.
p5-start.cppp5-start.cpp/**
* @author Jane Student
* @cwid 123 45 678
* @class CSci 430, Spring 2018
* @ide Visual Studio Express 2010
* @date November 15, 2018
* @assg prog-04
*
* @description This program implements a simulation of proce
ss
* scheduling policies. In this program, we implement round-
robin
* scheduling, where the time slice quantum can be specified a
s
* as a command line parameter. And we also implement shor
test
* remaining time (SRT) scheduling policy
*/
#include<stdlib.h>
#include<iostream>
#include<iomanip>
#include<fstream>
#include<string>
#include<list>
usingnamespace std;
// global constants
// I won't test your round robin implementation with more than 2
0 processes
constint MAX_PROCESSES =20;
constint NO_PROCESS =0;
// Simple structure, holds all of the information about processes,
their names
// arrival and service times, that we are to simulate.
typedefstruct
{
string processName;
int arrivalTime;
int serviceTime;
// holds running count of time slices for current time quantum,
when
// serviceTime == quantum, time slice is up
int sliceTime;
// holds total number of time steps currently run, when == to
// serviceTime process is done
int totalTime;
// holds time when process finishes, used to calculate final stats,
// like T_r, T_r/T_s
int finishTime;
// a boolean flag, we will set this to true when the process is co
mplete
bool finished;
}Process;
// Process table, holds table of information about processes we a
re simulating
typedefstruct
{
int numProcesses;
Process* process[MAX_PROCESSES];
}ProcessTable;
/** Create process table
* Allocate memory for a new process table. Load the process
* information from the simulation file into a table with the proc
ess
* information needed to perform the simulation. At the same ti
me we
* initialize other information in process table for use in the
* simulation. Return the newly created ProcessTable
*
* @param processFilanem The name (char*) of the file to open
and read
* the process information from.
* @param processTable This is actually a return parameter. Th
is
* should be a pointer to an already allocated array of
* Process structure items. We will fill in this structure
* and return the process information.
*
* @returns ProcessTable* The newly allocated and initialized P
rocessTable
* structure.
*/
ProcessTable* createProcessTable(char* processFilename)
{
ifstream simprocessfile(processFilename);
ProcessTable* processTable;
int pid;
string processName;
int arrivalTime;
int serviceTime;
// If we can't open file, abort and let the user know problem
if(!simprocessfile.is_open())
{
cout <<"Error: could not open process simulation file: "
<< processFilename << endl;
exit(1);
}
// Format of file is
// ProcessName1 ArrivalTime1 ServiceTime1
// ProcessName2 ArrivalTime2 ServiceTime2
// ...
// ProcessNameN ArrivalTimeN ServiceTimeN
//
// Where the name is any arbitray string identifier, and ArrivalT
ime
// and ServiceTime are integer values
pid =0;
processTable =new(ProcessTable);
while(simprocessfile >> processName >> arrivalTime >> servic
eTime)
{
// allocate a new process to hold information
Process* process =new(Process);
processTable->process[pid]= process;
// load information into process read from simulation file
process->processName = processName;
process->arrivalTime = arrivalTime;
process->serviceTime = serviceTime;
// initialize other process information for the simulaiton
process->sliceTime =0;
process->totalTime =0;
process->finishTime =0;
process->finished =false;
pid++;
}
// Set the number of processes we need to simulate information i
n
// the process table
processTable->numProcesses = pid;
return processTable;
}
/** Display process table
* Convenience method, dump all of the information about the p
rocesses
* in a process table to stdout.
*
* @param processTable The table, a pointer to type ProcessTab
le
* struct, with the information we are to display
*/
void displayProcessTable(ProcessTable* processTable)
{
cout <<"Process Table num = "<< processTable-
>numProcesses << endl;
cout <<"PID Name Arrv Srvc"<< endl;
cout <<"------------------"<< endl;
for(int pid=0; pid < processTable->numProcesses; pid++)
{
Process* p = processTable->process[pid];
cout << setw(2)<< right << pid <<") ";
cout << setw(4)<< left << p->processName <<" ";
cout << setw(4)<< right << p->arrivalTime <<" ";
cout << setw(4)<< right << p->serviceTime <<" ";
cout << endl;
}
}
/** Round robin scheduler simulator
* The main routine for performing the round robin preemptive
* scheduler simulator. We expect the time quantum to already
be
* specified and given to us as the first parameter. The file nam
e
* with the process arrival and service time information is given
as
* the second parameter. We simulate preemptive round robin
* scheduling of all of the processes until there are no longer an
y
* processes left in the system (all processes have exceeded thei
r
* service time and have exited).
*
* @param processTable A pointer to a ProcessTable structure h
olding
* information about the processes, arrival times and duratio
ns
* that we are simulating execution of.
* @param quantum An integer value holding the time slice qua
ntum we
* are using for this simulation.
*/
void roundRobinScheduler(ProcessTable* processTable,int quan
tum)
{
// Implement the round robin scheduler here
cout <<"<roundRobinScheduler> entered, quantum: "<< quant
um << endl;
}
/** shortest remaining time simulator
* The main routine for performing the shortest remaining time
* preemptive scheduler simulator. The file name with the proc
ess
* arrival and service time information is given as the first
* parameter. We simulate preemptive shortest remaining time
* scheduling of all of the processes until there are no longer an
y
* processes left in the system (all processes have exceeded thei
r
* service time and have exited).
*
* @param processTable A pointer to a ProcessTable structure h
olding
* information about the processes, arrival times and duratio
ns
* that we are simulating execution of.
*/
void shortestRemainingTime(ProcessTable* processTable)
{
// Implement the shortest remaining time policy here
cout <<"<shortestRemainingTime> entered"<< endl;
}
/** Main entry point of round robin scheduler
* The main entry point of the round robin scheduler simulator.
The main funciton
* checks the command line arguments, and calls the simulation
function if correct
* arguments were supplied. We expect two command line argu
ments, which are the
* time slice quantum value we are to use for this preemptive sc
heduler simulation,
* and the name of the simulation file holding the process arriva
l and service
* time information.
*
* @param argc The argument count
* @param argv The command line argument values. We expect
argv[1] to be the
* time slice quantum parameter (int format) and argv[2
] to be the
* name of the process simulation file (charcter string)
*/
int main(int argc,char** argv)
{
string policy;
ProcessTable* processTable;
int quantum =0;
// If not all parameters provides, abort and let user know of prob
lem
if(argc <3|| argc >4)
{
cout <<"Error: expecting process simulation file and scheduli
ng policy as command line parameters"
<< endl;
cout <<"Usage: "<< argv[0]<<" process-
file.sim [rr|srt] [quantum]"<< endl;
exit(1);
}
// load process table and parse command line arguments
processTable = createProcessTable(argv[1]);
// just to confirm that process table loaded correctly. You shoul
d
// comment out or remove this as it is not asked for as part of th
e
// output for the assignment simulation
displayProcessTable(processTable);
// determine policy to simulate
policy.assign(argv[2]);
// perform simulation of indicated scheduling policy
if(policy =="rr")
{
if(argc !=4)
{
cout <<"Error: time quantum must be provided for round ro
bin `rr` scheduling policy"<< endl;
exit(1);
}
quantum = atoi(argv[3]);
if((quantum <=0)||(quantum >1000))
{
cout <<"Error: received bad time slice quantum parameter:
"<< argv[1]<< endl;
cout <<" valid values are integers in range from 1 to 10
00"<< endl;
exit(1);
}
roundRobinScheduler(processTable, quantum);
}
elseif(policy =="srt")
{
shortestRemainingTime(processTable);
}
else
{
cout <<"Error: unknown process scheduling policy: "<< polic
y << endl;
}
}
prog-05.pdf
Programming Assignment #5
CSci 430, Spring 2019
Dates:
Assigned: Monday April 15, 2019
Due: Wednesday May 1, 2019 (before Midnight)
Objectives:
� Understand short-term process scheduling.
� Work with data structures to implement a round-robin
scheduler.
� Look at e�ects of di�erent time slice quantum sizes on the
round-robin scheduling algorithm.
� Use C/C++ to implement vector and matrix data structures,
get practice in creating and using
such data structures in C/C++.
Description:
Our textbooks chapter 9 discusses several possible short-term
process scheduling policies. In this
programming assignment exercise we will implement two of the
preemptive policies, the simple shortest
remaining time policy (SRT) and the round-robin scheduler with
preemptive time slicing. Your program
will be given a simple input �le, indicating the process name,
its arrival time and its total service time,
the same as the process scheduling examples from our textbook
in Table 9.4 and Figure 9.5. You will
simulate the execution of the required schedulers. As in
previous assignments, you program will need
to work non-interactively and be callable from the command
line. The program will be provided with
the �le name of a �le with process information, in the format
discussed below. Your program will also
be given the time slicing quantum parameter it is to use for the
simulation, if round-robin scheduling
is selected. Your program will need to output the results of
running the set of simulated processes
using the selected scheduling policy with the indicated time
slice for the round-robin scheduler. Your
program will have to output its results exactly as shown below
in the required output format. Your
program will also need to calculate some summary statistics for
the simulated processes, including the
turnaround time and Tr/Ts ratio for each process, and the mean
Tr and Tr/Ts values for the given
simulation.
Process simulation �le formats
The �les with the information about the processes to be
simulated are fairly simple, and have the same
information that our textbook uses to illustrate the process
scheduling examples. Each simulation �le
contains multiple rows of data, where each row consists of the
process name, its arrival time, and its
service time. Here is an example:
1
A 0 3
B 2 6
C 4 4
D 6 5
E 8 2
This �le is named process-01.sim in the zip archive of �les I
have given you to get started on this
assignment. This is also the same set of processes and
start/service times used for all of the examples
in table 9.4 and �gure 9.5.
Running Simulations
As with previous assignments you are required to support using
your simulation from the command
line. Your program will take the name of the �le containing the
process information �rst. The next
parameter will be either 'rr' to perform round-robin scheduling,
or 'srt' if shortest remaining time policy
is to be simulated. Finally, a 3rd parameter will be supplied for
the round-robin scheduler, the time
slice quantum to use. An example of running your �nished
program should look like this:
$ ./p3 process-01.sim rr 4
A A A B B B B C C C C D D D D B B E E D
Name Fnsh T_r T_r/T_s
----------------------
A 3 3 1
B 17 15 2.5
C 11 7 1.75
D 20 14 2.8
E 19 11 5.5
Here we are running the simulation using the set of process
information given in the previous section
and with a time slice quantum of 4.
Required Output
As shown above, your program must generate 2 bits of output.
First of all, while running the simulation
of the selected scheduling policy, you should display the
process names in the order they are run. In
the previous example, the sequence of scheduled/run processes
was:
A A A B B B B C C C C D D D D B B E E D
This indicates that process A ran �rst (times 0, 1 and 2),
followed by B running 4 times (times 3
to 7), etc. You are required to output the sequence of process
runs as the �rst line of output, with a
single space in between each process name as shown.
After the processes have run, you need to calculate and display
the statistics for the processes that
you just simulated. In our previous example, the statistics for
our round-robin simulation with a time
quantum of 4 time slices were:
Name Fnsh T_r T_r/T_s
----------------------
A 3 3 1
B 17 15 2.5
C 11 7 1.75
2
D 20 14 2.8
E 19 11 5.5
For each process, you need to output the time when it �nished,
the turnaround time (Tr) and the
ratio of the turnaround time to the service time (Tr/Ts).
I have provided a zip �le with a �le named p3-start.cpp as a
template to get you started. In addition,
I have provided you with two process simulation �les, named
process-01.sim and process-02.sim, with
2 sets of process information you can simulate. There are
several examples of correct results generated
for the two sets of inputs, named things like process-01-q1.res,
process-01-q4.res, process-01-srt.res, etc.
These are the correct results you should get for running your
simulation with round-robin scheduling
for various time quantums or for shortest remaining time
scheduling.
3
processtable-01.sim
A 0 3
B 2 6
C 4 4
D 6 5
E 8 2
processtable-02.sim
A 0 4
B 1 7
C 4 5
D 4 5
E 7 2
F 8 5
G 10 1
H 10 4
I 12 6
processtable-03.sim
A 0 3
B 2 4
C 3 5
D 3 8
E 3 2
F 5 6
G 7 9
H 7 4
I 8 3
J 8 5
K 8 4
L 10 6
Makefile
all: p5sol
p5: p5-start.cpp
g++ -g $< -o [email protected]
p5sol: p5-solution.cpp
g++ -g $< -o p5
debug: p5-solution.cpp
g++ -DDEBUG_BUILD=1 -g $< -o p5
p5test:
./p5 processtable-01.sim rr 1 > sim-01-rr-1.tst
@diff -s -q sim-01-rr-1.tst sim-01-rr-1.res
./p5 processtable-01.sim rr 4 > sim-01-rr-4.tst
@diff -s -q sim-01-rr-4.tst sim-01-rr-4.res
./p5 processtable-01.sim srt > sim-01-srt.tst
@diff -s -q sim-01-srt.tst sim-01-srt.res
./p5 processtable-02.sim rr 1 > sim-02-rr-1.tst
@diff -s -q sim-02-rr-1.tst sim-02-rr-1.res
./p5 processtable-02.sim rr 4 > sim-02-rr-4.tst
@diff -s -q sim-02-rr-4.tst sim-02-rr-4.res
./p5 processtable-02.sim srt > sim-02-srt.tst
@diff -s -q sim-02-srt.tst sim-02-srt.res
./p5 processtable-03.sim rr 1 > sim-03-rr-1.tst
@diff -s -q sim-03-rr-1.tst sim-03-rr-1.res
./p5 processtable-03.sim rr 5 > sim-03-rr-5.tst
@diff -s -q sim-03-rr-5.tst sim-03-rr-5.res
./p5 processtable-03.sim srt > sim-03-srt.tst
@diff -s -q sim-03-srt.tst sim-03-srt.res
@rm sim-01-rr-1.tst sim-01-rr-4.tst sim-01-srt.tst sim-02-
rr-1.tst sim-02-rr-4.tst sim-02-srt.tst sim-03-rr-1.tst sim-03-rr-
5.tst sim-03-srt.tst
p5zip:
zip ../prog-05.zip p5-start.cpp prog-05.pdf processtable-
01.sim processtable-02.sim processtable-03.sim Makefile *.res
p5solzip:
zip ../prog-05-sol.zip p5-solution.cpp processtable-*.sim
sim-*.res
clean:
rm -f p5 sim-*.tst core* *~
sim-01-rr-1.res
sim-01-rr-4.res
sim-01-srt.res
sim-02-rr-1.res
sim-02-rr-4.res
sim-02-srt.res
sim-03-rr-1.res
sim-03-rr-5.res
sim-03-srt.res
Programming Assignment #5
CSci 430, Spring 2019
Dates:
Assigned: Monday April 15, 2019
Due: Wednesday May 1, 2019 (before Midnight)
Objectives:
� Understand short-term process scheduling.
� Work with data structures to implement a round-robin
scheduler.
� Look at e�ects of di�erent time slice quantum sizes on the
round-robin scheduling algorithm.
� Use C/C++ to implement vector and matrix data structures,
get practice in creating and using
such data structures in C/C++.
Description:
Our textbooks chapter 9 discusses several possible short-term
process scheduling policies. In this
programming assignment exercise we will implement two of the
preemptive policies, the simple shortest
remaining time policy (SRT) and the round-robin scheduler with
preemptive time slicing. Your program
will be given a simple input �le, indicating the process name,
its arrival time and its total service time,
the same as the process scheduling examples from our textbook
in Table 9.4 and Figure 9.5. You will
simulate the execution of the required schedulers. As in
previous assignments, you program will need
to work non-interactively and be callable from the command
line. The program will be provided with
the �le name of a �le with process information, in the format
discussed below. Your program will also
be given the time slicing quantum parameter it is to use for the
simulation, if round-robin scheduling
is selected. Your program will need to output the results of
running the set of simulated processes
using the selected scheduling policy with the indicated time
slice for the round-robin scheduler. Your
program will have to output its results exactly as shown below
in the required output format. Your
program will also need to calculate some summary statistics for
the simulated processes, including the
turnaround time and Tr/Ts ratio for each process, and the mean
Tr and Tr/Ts values for the given
simulation.
Process simulation �le formats
The �les with the information about the processes to be
simulated are fairly simple, and have the same
information that our textbook uses to illustrate the process
scheduling examples. Each simulation �le
contains multiple rows of data, where each row consists of the
process name, its arrival time, and its
service time. Here is an example:
1
A 0 3
B 2 6
C 4 4
D 6 5
E 8 2
This �le is named process-01.sim in the zip archive of �les I
have given you to get started on this
assignment. This is also the same set of processes and
start/service times used for all of the examples
in table 9.4 and �gure 9.5.
Running Simulations
As with previous assignments you are required to support using
your simulation from the command
line. Your program will take the name of the �le containing the
process information �rst. The next
parameter will be either 'rr' to perform round-robin scheduling,
or 'srt' if shortest remaining time policy
is to be simulated. Finally, a 3rd parameter will be supplied for
the round-robin scheduler, the time
slice quantum to use. An example of running your �nished
program should look like this:
$ ./p3 process-01.sim rr 4
A A A B B B B C C C C D D D D B B E E D
Name Fnsh T_r T_r/T_s
----------------------
A 3 3 1
B 17 15 2.5
C 11 7 1.75
D 20 14 2.8
E 19 11 5.5
Here we are running the simulation using the set of process
information given in the previous section
and with a time slice quantum of 4.
Required Output
As shown above, your program must generate 2 bits of output.
First of all, while running the simulation
of the selected scheduling policy, you should display the
process names in the order they are run. In
the previous example, the sequence of scheduled/run processes
was:
A A A B B B B C C C C D D D D B B E E D
This indicates that process A ran �rst (times 0, 1 and 2),
followed by B running 4 times (times 3
to 7), etc. You are required to output the sequence of process
runs as the �rst line of output, with a
single space in between each process name as shown.
After the processes have run, you need to calculate and display
the statistics for the processes that
you just simulated. In our previous example, the statistics for
our round-robin simulation with a time
quantum of 4 time slices were:
Name Fnsh T_r T_r/T_s
----------------------
A 3 3 1
B 17 15 2.5
C 11 7 1.75
2
D 20 14 2.8
E 19 11 5.5
For each process, you need to output the time when it �nished,
the turnaround time (Tr) and the
ratio of the turnaround time to the service time (Tr/Ts).
I have provided a zip �le with a �le named p3-start.cpp as a
template to get you started. In addition,
I have provided you with two process simulation �les, named
process-01.sim and process-02.sim, with
2 sets of process information you can simulate. There are
several examples of correct results generated
for the two sets of inputs, named things like process-01-q1.res,
process-01-q4.res, process-01-srt.res, etc.
These are the correct results you should get for running your
simulation with round-robin scheduling
for various time quantums or for shortest remaining time
scheduling.
3

More Related Content

Similar to Instruction1. Please read the two articles. (Kincheloe part 1 &.docx

Router Queue Simulation in C++ in MMNN and MM1 conditions
Router Queue Simulation in C++ in MMNN and MM1 conditionsRouter Queue Simulation in C++ in MMNN and MM1 conditions
Router Queue Simulation in C++ in MMNN and MM1 conditionsMorteza Mahdilar
 
An eternal question of timing
An eternal question of timingAn eternal question of timing
An eternal question of timingPVS-Studio
 
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdfProgramming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdfssuser6254411
 
Need help implementing the skeleton code below, I have provided the .pdf
Need help implementing the skeleton code below, I have provided the .pdfNeed help implementing the skeleton code below, I have provided the .pdf
Need help implementing the skeleton code below, I have provided the .pdfezzi552
 
Simple API for XML
Simple API for XMLSimple API for XML
Simple API for XMLguest2556de
 
How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012Connor McDonald
 
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docxodiliagilby
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfyamew16788
 
Timers in Unix/Linux
Timers in Unix/LinuxTimers in Unix/Linux
Timers in Unix/Linuxgeeksrik
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityBrendan Gregg
 
Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"Yulia Tsisyk
 
State of the .Net Performance
State of the .Net PerformanceState of the .Net Performance
State of the .Net PerformanceCUSTIS
 
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the bfinalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the bChereCheek752
 
Here is the code- I can't get it to work- I need a function that finds.pdf
Here is the code- I can't get it to work- I need a function that finds.pdfHere is the code- I can't get it to work- I need a function that finds.pdf
Here is the code- I can't get it to work- I need a function that finds.pdfdoshirajesh75
 
please help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdfplease help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdfanfenterprises
 
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdfimport java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdfadhityalapcare
 

Similar to Instruction1. Please read the two articles. (Kincheloe part 1 &.docx (20)

Router Queue Simulation in C++ in MMNN and MM1 conditions
Router Queue Simulation in C++ in MMNN and MM1 conditionsRouter Queue Simulation in C++ in MMNN and MM1 conditions
Router Queue Simulation in C++ in MMNN and MM1 conditions
 
An eternal question of timing
An eternal question of timingAn eternal question of timing
An eternal question of timing
 
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdfProgramming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdf
 
Need help implementing the skeleton code below, I have provided the .pdf
Need help implementing the skeleton code below, I have provided the .pdfNeed help implementing the skeleton code below, I have provided the .pdf
Need help implementing the skeleton code below, I have provided the .pdf
 
Simple API for XML
Simple API for XMLSimple API for XML
Simple API for XML
 
How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012How to tune a query - ODTUG 2012
How to tune a query - ODTUG 2012
 
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdf
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
 
Timers in Unix/Linux
Timers in Unix/LinuxTimers in Unix/Linux
Timers in Unix/Linux
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF Observability
 
Ping to Pong
Ping to PongPing to Pong
Ping to Pong
 
lecture56.ppt
lecture56.pptlecture56.ppt
lecture56.ppt
 
Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"
 
State of the .Net Performance
State of the .Net PerformanceState of the .Net Performance
State of the .Net Performance
 
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the bfinalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
 
Here is the code- I can't get it to work- I need a function that finds.pdf
Here is the code- I can't get it to work- I need a function that finds.pdfHere is the code- I can't get it to work- I need a function that finds.pdf
Here is the code- I can't get it to work- I need a function that finds.pdf
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
please help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdfplease help finish sorting methods- import java-util-Arrays- import ja.pdf
please help finish sorting methods- import java-util-Arrays- import ja.pdf
 
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdfimport java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
import java-util-Arrays- import java-io-PrintWriter- import java-io-Fi.pdf
 

More from carliotwaycave

make sure to discuss the following•your understanding of t.docx
make sure to discuss the following•your understanding of t.docxmake sure to discuss the following•your understanding of t.docx
make sure to discuss the following•your understanding of t.docxcarliotwaycave
 
make sure to discuss the following•your understanding of .docx
make sure to discuss the following•your understanding of .docxmake sure to discuss the following•your understanding of .docx
make sure to discuss the following•your understanding of .docxcarliotwaycave
 
make sure to discuss the following•your understanding o.docx
make sure to discuss the following•your understanding o.docxmake sure to discuss the following•your understanding o.docx
make sure to discuss the following•your understanding o.docxcarliotwaycave
 
Major DiseasesCHAPTER 10Chapter 10Maj.docx
Major DiseasesCHAPTER 10Chapter 10Maj.docxMajor DiseasesCHAPTER 10Chapter 10Maj.docx
Major DiseasesCHAPTER 10Chapter 10Maj.docxcarliotwaycave
 
Main questions of the essay1. What are types of daily-lived situat.docx
Main questions of the essay1. What are types of daily-lived situat.docxMain questions of the essay1. What are types of daily-lived situat.docx
Main questions of the essay1. What are types of daily-lived situat.docxcarliotwaycave
 
Make a simple plan to observe and evaluate a facility in your school.docx
Make a simple plan to observe and evaluate a facility in your school.docxMake a simple plan to observe and evaluate a facility in your school.docx
Make a simple plan to observe and evaluate a facility in your school.docxcarliotwaycave
 
Major Approaches to Clinical Psychology PresentationSelect one.docx
Major Approaches to Clinical Psychology PresentationSelect one.docxMajor Approaches to Clinical Psychology PresentationSelect one.docx
Major Approaches to Clinical Psychology PresentationSelect one.docxcarliotwaycave
 
Make a powerpoint presentation. At least 4 to 6 pages. Your pape.docx
Make a powerpoint presentation. At least 4 to 6 pages. Your pape.docxMake a powerpoint presentation. At least 4 to 6 pages. Your pape.docx
Make a powerpoint presentation. At least 4 to 6 pages. Your pape.docxcarliotwaycave
 
Make a 150 word response to the following. Incorporarte what was sai.docx
Make a 150 word response to the following. Incorporarte what was sai.docxMake a 150 word response to the following. Incorporarte what was sai.docx
Make a 150 word response to the following. Incorporarte what was sai.docxcarliotwaycave
 
Major dams and bridges were built by the WPA during the New Deal o.docx
Major dams and bridges were built by the WPA during the New Deal o.docxMajor dams and bridges were built by the WPA during the New Deal o.docx
Major dams and bridges were built by the WPA during the New Deal o.docxcarliotwaycave
 
Major Paper #1--The Point of View EssayWe will be working on this .docx
Major Paper #1--The Point of View EssayWe will be working on this .docxMajor Paper #1--The Point of View EssayWe will be working on this .docx
Major Paper #1--The Point of View EssayWe will be working on this .docxcarliotwaycave
 
Major Essay for Final needs to be 5 pages long on the topic below an.docx
Major Essay for Final needs to be 5 pages long on the topic below an.docxMajor Essay for Final needs to be 5 pages long on the topic below an.docx
Major Essay for Final needs to be 5 pages long on the topic below an.docxcarliotwaycave
 
Major AssignmentObjectivesThis assignment will provide practice .docx
Major AssignmentObjectivesThis assignment will provide practice .docxMajor AssignmentObjectivesThis assignment will provide practice .docx
Major AssignmentObjectivesThis assignment will provide practice .docxcarliotwaycave
 
magine that you are employed by one of the followingT.docx
magine that you are employed by one of the followingT.docxmagine that you are employed by one of the followingT.docx
magine that you are employed by one of the followingT.docxcarliotwaycave
 
M4D1 Communication TechnologiesIn this module, we have focused .docx
M4D1 Communication TechnologiesIn this module, we have focused .docxM4D1 Communication TechnologiesIn this module, we have focused .docx
M4D1 Communication TechnologiesIn this module, we have focused .docxcarliotwaycave
 
M A N N I N GRobert I. KabacoffSECOND EDITION IN A.docx
M A N N I N GRobert I. KabacoffSECOND EDITION IN A.docxM A N N I N GRobert I. KabacoffSECOND EDITION IN A.docx
M A N N I N GRobert I. KabacoffSECOND EDITION IN A.docxcarliotwaycave
 
Luthans and Doh (2012) discuss three major techniques for responding.docx
Luthans and Doh (2012) discuss three major techniques for responding.docxLuthans and Doh (2012) discuss three major techniques for responding.docx
Luthans and Doh (2012) discuss three major techniques for responding.docxcarliotwaycave
 
Lyddie by Katherine Paterson1. If you were Lyddie how would you h.docx
Lyddie by Katherine Paterson1. If you were Lyddie how would you h.docxLyddie by Katherine Paterson1. If you were Lyddie how would you h.docx
Lyddie by Katherine Paterson1. If you were Lyddie how would you h.docxcarliotwaycave
 
Luthans and Doh (2012) discuss feedback systems. Why is it important.docx
Luthans and Doh (2012) discuss feedback systems. Why is it important.docxLuthans and Doh (2012) discuss feedback systems. Why is it important.docx
Luthans and Doh (2012) discuss feedback systems. Why is it important.docxcarliotwaycave
 
Luthans and Doh (2012) discuss factors affecting decision-making aut.docx
Luthans and Doh (2012) discuss factors affecting decision-making aut.docxLuthans and Doh (2012) discuss factors affecting decision-making aut.docx
Luthans and Doh (2012) discuss factors affecting decision-making aut.docxcarliotwaycave
 

More from carliotwaycave (20)

make sure to discuss the following•your understanding of t.docx
make sure to discuss the following•your understanding of t.docxmake sure to discuss the following•your understanding of t.docx
make sure to discuss the following•your understanding of t.docx
 
make sure to discuss the following•your understanding of .docx
make sure to discuss the following•your understanding of .docxmake sure to discuss the following•your understanding of .docx
make sure to discuss the following•your understanding of .docx
 
make sure to discuss the following•your understanding o.docx
make sure to discuss the following•your understanding o.docxmake sure to discuss the following•your understanding o.docx
make sure to discuss the following•your understanding o.docx
 
Major DiseasesCHAPTER 10Chapter 10Maj.docx
Major DiseasesCHAPTER 10Chapter 10Maj.docxMajor DiseasesCHAPTER 10Chapter 10Maj.docx
Major DiseasesCHAPTER 10Chapter 10Maj.docx
 
Main questions of the essay1. What are types of daily-lived situat.docx
Main questions of the essay1. What are types of daily-lived situat.docxMain questions of the essay1. What are types of daily-lived situat.docx
Main questions of the essay1. What are types of daily-lived situat.docx
 
Make a simple plan to observe and evaluate a facility in your school.docx
Make a simple plan to observe and evaluate a facility in your school.docxMake a simple plan to observe and evaluate a facility in your school.docx
Make a simple plan to observe and evaluate a facility in your school.docx
 
Major Approaches to Clinical Psychology PresentationSelect one.docx
Major Approaches to Clinical Psychology PresentationSelect one.docxMajor Approaches to Clinical Psychology PresentationSelect one.docx
Major Approaches to Clinical Psychology PresentationSelect one.docx
 
Make a powerpoint presentation. At least 4 to 6 pages. Your pape.docx
Make a powerpoint presentation. At least 4 to 6 pages. Your pape.docxMake a powerpoint presentation. At least 4 to 6 pages. Your pape.docx
Make a powerpoint presentation. At least 4 to 6 pages. Your pape.docx
 
Make a 150 word response to the following. Incorporarte what was sai.docx
Make a 150 word response to the following. Incorporarte what was sai.docxMake a 150 word response to the following. Incorporarte what was sai.docx
Make a 150 word response to the following. Incorporarte what was sai.docx
 
Major dams and bridges were built by the WPA during the New Deal o.docx
Major dams and bridges were built by the WPA during the New Deal o.docxMajor dams and bridges were built by the WPA during the New Deal o.docx
Major dams and bridges were built by the WPA during the New Deal o.docx
 
Major Paper #1--The Point of View EssayWe will be working on this .docx
Major Paper #1--The Point of View EssayWe will be working on this .docxMajor Paper #1--The Point of View EssayWe will be working on this .docx
Major Paper #1--The Point of View EssayWe will be working on this .docx
 
Major Essay for Final needs to be 5 pages long on the topic below an.docx
Major Essay for Final needs to be 5 pages long on the topic below an.docxMajor Essay for Final needs to be 5 pages long on the topic below an.docx
Major Essay for Final needs to be 5 pages long on the topic below an.docx
 
Major AssignmentObjectivesThis assignment will provide practice .docx
Major AssignmentObjectivesThis assignment will provide practice .docxMajor AssignmentObjectivesThis assignment will provide practice .docx
Major AssignmentObjectivesThis assignment will provide practice .docx
 
magine that you are employed by one of the followingT.docx
magine that you are employed by one of the followingT.docxmagine that you are employed by one of the followingT.docx
magine that you are employed by one of the followingT.docx
 
M4D1 Communication TechnologiesIn this module, we have focused .docx
M4D1 Communication TechnologiesIn this module, we have focused .docxM4D1 Communication TechnologiesIn this module, we have focused .docx
M4D1 Communication TechnologiesIn this module, we have focused .docx
 
M A N N I N GRobert I. KabacoffSECOND EDITION IN A.docx
M A N N I N GRobert I. KabacoffSECOND EDITION IN A.docxM A N N I N GRobert I. KabacoffSECOND EDITION IN A.docx
M A N N I N GRobert I. KabacoffSECOND EDITION IN A.docx
 
Luthans and Doh (2012) discuss three major techniques for responding.docx
Luthans and Doh (2012) discuss three major techniques for responding.docxLuthans and Doh (2012) discuss three major techniques for responding.docx
Luthans and Doh (2012) discuss three major techniques for responding.docx
 
Lyddie by Katherine Paterson1. If you were Lyddie how would you h.docx
Lyddie by Katherine Paterson1. If you were Lyddie how would you h.docxLyddie by Katherine Paterson1. If you were Lyddie how would you h.docx
Lyddie by Katherine Paterson1. If you were Lyddie how would you h.docx
 
Luthans and Doh (2012) discuss feedback systems. Why is it important.docx
Luthans and Doh (2012) discuss feedback systems. Why is it important.docxLuthans and Doh (2012) discuss feedback systems. Why is it important.docx
Luthans and Doh (2012) discuss feedback systems. Why is it important.docx
 
Luthans and Doh (2012) discuss factors affecting decision-making aut.docx
Luthans and Doh (2012) discuss factors affecting decision-making aut.docxLuthans and Doh (2012) discuss factors affecting decision-making aut.docx
Luthans and Doh (2012) discuss factors affecting decision-making aut.docx
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 

Instruction1. Please read the two articles. (Kincheloe part 1 &.docx

  • 1. Instruction: 1. Please read the two articles. (Kincheloe part 1 & 2) 2. Please choose some of the topics covered in each chapter, provide a brief summary (2-3 sentences) of those topics. 3. Then add your reflections, insights, or relevant experiences, etc. to help illustrate or expand upon the course. 4. This journal should be at least 400 words. p5-start.cppp5-start.cpp/** * @author Jane Student * @cwid 123 45 678 * @class CSci 430, Spring 2018 * @ide Visual Studio Express 2010 * @date November 15, 2018 * @assg prog-04 * * @description This program implements a simulation of proce ss * scheduling policies. In this program, we implement round- robin * scheduling, where the time slice quantum can be specified a s * as a command line parameter. And we also implement shor test * remaining time (SRT) scheduling policy */ #include<stdlib.h> #include<iostream> #include<iomanip> #include<fstream> #include<string> #include<list>
  • 2. usingnamespace std; // global constants // I won't test your round robin implementation with more than 2 0 processes constint MAX_PROCESSES =20; constint NO_PROCESS =0; // Simple structure, holds all of the information about processes, their names // arrival and service times, that we are to simulate. typedefstruct { string processName; int arrivalTime; int serviceTime; // holds running count of time slices for current time quantum, when // serviceTime == quantum, time slice is up int sliceTime; // holds total number of time steps currently run, when == to // serviceTime process is done int totalTime; // holds time when process finishes, used to calculate final stats, // like T_r, T_r/T_s int finishTime; // a boolean flag, we will set this to true when the process is co mplete bool finished; }Process; // Process table, holds table of information about processes we a re simulating typedefstruct {
  • 3. int numProcesses; Process* process[MAX_PROCESSES]; }ProcessTable; /** Create process table * Allocate memory for a new process table. Load the process * information from the simulation file into a table with the proc ess * information needed to perform the simulation. At the same ti me we * initialize other information in process table for use in the * simulation. Return the newly created ProcessTable * * @param processFilanem The name (char*) of the file to open and read * the process information from. * @param processTable This is actually a return parameter. Th is * should be a pointer to an already allocated array of * Process structure items. We will fill in this structure * and return the process information. * * @returns ProcessTable* The newly allocated and initialized P rocessTable * structure. */ ProcessTable* createProcessTable(char* processFilename) { ifstream simprocessfile(processFilename); ProcessTable* processTable; int pid; string processName; int arrivalTime; int serviceTime;
  • 4. // If we can't open file, abort and let the user know problem if(!simprocessfile.is_open()) { cout <<"Error: could not open process simulation file: " << processFilename << endl; exit(1); } // Format of file is // ProcessName1 ArrivalTime1 ServiceTime1 // ProcessName2 ArrivalTime2 ServiceTime2 // ... // ProcessNameN ArrivalTimeN ServiceTimeN // // Where the name is any arbitray string identifier, and ArrivalT ime // and ServiceTime are integer values pid =0; processTable =new(ProcessTable); while(simprocessfile >> processName >> arrivalTime >> servic eTime) { // allocate a new process to hold information Process* process =new(Process); processTable->process[pid]= process; // load information into process read from simulation file process->processName = processName; process->arrivalTime = arrivalTime; process->serviceTime = serviceTime; // initialize other process information for the simulaiton process->sliceTime =0; process->totalTime =0; process->finishTime =0; process->finished =false;
  • 5. pid++; } // Set the number of processes we need to simulate information i n // the process table processTable->numProcesses = pid; return processTable; } /** Display process table * Convenience method, dump all of the information about the p rocesses * in a process table to stdout. * * @param processTable The table, a pointer to type ProcessTab le * struct, with the information we are to display */ void displayProcessTable(ProcessTable* processTable) { cout <<"Process Table num = "<< processTable- >numProcesses << endl; cout <<"PID Name Arrv Srvc"<< endl; cout <<"------------------"<< endl; for(int pid=0; pid < processTable->numProcesses; pid++) { Process* p = processTable->process[pid]; cout << setw(2)<< right << pid <<") "; cout << setw(4)<< left << p->processName <<" "; cout << setw(4)<< right << p->arrivalTime <<" "; cout << setw(4)<< right << p->serviceTime <<" "; cout << endl;
  • 6. } } /** Round robin scheduler simulator * The main routine for performing the round robin preemptive * scheduler simulator. We expect the time quantum to already be * specified and given to us as the first parameter. The file nam e * with the process arrival and service time information is given as * the second parameter. We simulate preemptive round robin * scheduling of all of the processes until there are no longer an y * processes left in the system (all processes have exceeded thei r * service time and have exited). * * @param processTable A pointer to a ProcessTable structure h olding * information about the processes, arrival times and duratio ns * that we are simulating execution of. * @param quantum An integer value holding the time slice qua ntum we * are using for this simulation. */ void roundRobinScheduler(ProcessTable* processTable,int quan tum) { // Implement the round robin scheduler here cout <<"<roundRobinScheduler> entered, quantum: "<< quant um << endl; }
  • 7. /** shortest remaining time simulator * The main routine for performing the shortest remaining time * preemptive scheduler simulator. The file name with the proc ess * arrival and service time information is given as the first * parameter. We simulate preemptive shortest remaining time * scheduling of all of the processes until there are no longer an y * processes left in the system (all processes have exceeded thei r * service time and have exited). * * @param processTable A pointer to a ProcessTable structure h olding * information about the processes, arrival times and duratio ns * that we are simulating execution of. */ void shortestRemainingTime(ProcessTable* processTable) { // Implement the shortest remaining time policy here cout <<"<shortestRemainingTime> entered"<< endl; } /** Main entry point of round robin scheduler * The main entry point of the round robin scheduler simulator. The main funciton * checks the command line arguments, and calls the simulation function if correct * arguments were supplied. We expect two command line argu ments, which are the * time slice quantum value we are to use for this preemptive sc heduler simulation, * and the name of the simulation file holding the process arriva
  • 8. l and service * time information. * * @param argc The argument count * @param argv The command line argument values. We expect argv[1] to be the * time slice quantum parameter (int format) and argv[2 ] to be the * name of the process simulation file (charcter string) */ int main(int argc,char** argv) { string policy; ProcessTable* processTable; int quantum =0; // If not all parameters provides, abort and let user know of prob lem if(argc <3|| argc >4) { cout <<"Error: expecting process simulation file and scheduli ng policy as command line parameters" << endl; cout <<"Usage: "<< argv[0]<<" process- file.sim [rr|srt] [quantum]"<< endl; exit(1); } // load process table and parse command line arguments processTable = createProcessTable(argv[1]); // just to confirm that process table loaded correctly. You shoul d // comment out or remove this as it is not asked for as part of th e // output for the assignment simulation displayProcessTable(processTable);
  • 9. // determine policy to simulate policy.assign(argv[2]); // perform simulation of indicated scheduling policy if(policy =="rr") { if(argc !=4) { cout <<"Error: time quantum must be provided for round ro bin `rr` scheduling policy"<< endl; exit(1); } quantum = atoi(argv[3]); if((quantum <=0)||(quantum >1000)) { cout <<"Error: received bad time slice quantum parameter: "<< argv[1]<< endl; cout <<" valid values are integers in range from 1 to 10 00"<< endl; exit(1); } roundRobinScheduler(processTable, quantum); } elseif(policy =="srt") { shortestRemainingTime(processTable); } else { cout <<"Error: unknown process scheduling policy: "<< polic y << endl; } }
  • 10. prog-05.pdf Programming Assignment #5 CSci 430, Spring 2019 Dates: Assigned: Monday April 15, 2019 Due: Wednesday May 1, 2019 (before Midnight) Objectives: � Understand short-term process scheduling. � Work with data structures to implement a round-robin scheduler. � Look at e�ects of di�erent time slice quantum sizes on the round-robin scheduling algorithm. � Use C/C++ to implement vector and matrix data structures, get practice in creating and using such data structures in C/C++. Description: Our textbooks chapter 9 discusses several possible short-term process scheduling policies. In this programming assignment exercise we will implement two of the preemptive policies, the simple shortest remaining time policy (SRT) and the round-robin scheduler with preemptive time slicing. Your program will be given a simple input �le, indicating the process name,
  • 11. its arrival time and its total service time, the same as the process scheduling examples from our textbook in Table 9.4 and Figure 9.5. You will simulate the execution of the required schedulers. As in previous assignments, you program will need to work non-interactively and be callable from the command line. The program will be provided with the �le name of a �le with process information, in the format discussed below. Your program will also be given the time slicing quantum parameter it is to use for the simulation, if round-robin scheduling is selected. Your program will need to output the results of running the set of simulated processes using the selected scheduling policy with the indicated time slice for the round-robin scheduler. Your program will have to output its results exactly as shown below in the required output format. Your program will also need to calculate some summary statistics for the simulated processes, including the turnaround time and Tr/Ts ratio for each process, and the mean Tr and Tr/Ts values for the given simulation. Process simulation �le formats The �les with the information about the processes to be simulated are fairly simple, and have the same information that our textbook uses to illustrate the process scheduling examples. Each simulation �le contains multiple rows of data, where each row consists of the process name, its arrival time, and its service time. Here is an example: 1
  • 12. A 0 3 B 2 6 C 4 4 D 6 5 E 8 2 This �le is named process-01.sim in the zip archive of �les I have given you to get started on this assignment. This is also the same set of processes and start/service times used for all of the examples in table 9.4 and �gure 9.5. Running Simulations As with previous assignments you are required to support using your simulation from the command line. Your program will take the name of the �le containing the process information �rst. The next parameter will be either 'rr' to perform round-robin scheduling, or 'srt' if shortest remaining time policy is to be simulated. Finally, a 3rd parameter will be supplied for the round-robin scheduler, the time slice quantum to use. An example of running your �nished program should look like this: $ ./p3 process-01.sim rr 4 A A A B B B B C C C C D D D D B B E E D Name Fnsh T_r T_r/T_s
  • 13. ---------------------- A 3 3 1 B 17 15 2.5 C 11 7 1.75 D 20 14 2.8 E 19 11 5.5 Here we are running the simulation using the set of process information given in the previous section and with a time slice quantum of 4. Required Output As shown above, your program must generate 2 bits of output. First of all, while running the simulation of the selected scheduling policy, you should display the process names in the order they are run. In the previous example, the sequence of scheduled/run processes was: A A A B B B B C C C C D D D D B B E E D This indicates that process A ran �rst (times 0, 1 and 2), followed by B running 4 times (times 3 to 7), etc. You are required to output the sequence of process runs as the �rst line of output, with a single space in between each process name as shown. After the processes have run, you need to calculate and display the statistics for the processes that you just simulated. In our previous example, the statistics for
  • 14. our round-robin simulation with a time quantum of 4 time slices were: Name Fnsh T_r T_r/T_s ---------------------- A 3 3 1 B 17 15 2.5 C 11 7 1.75 2 D 20 14 2.8 E 19 11 5.5 For each process, you need to output the time when it �nished, the turnaround time (Tr) and the ratio of the turnaround time to the service time (Tr/Ts). I have provided a zip �le with a �le named p3-start.cpp as a template to get you started. In addition, I have provided you with two process simulation �les, named process-01.sim and process-02.sim, with 2 sets of process information you can simulate. There are several examples of correct results generated for the two sets of inputs, named things like process-01-q1.res, process-01-q4.res, process-01-srt.res, etc. These are the correct results you should get for running your simulation with round-robin scheduling for various time quantums or for shortest remaining time
  • 15. scheduling. 3 processtable-01.sim A 0 3 B 2 6 C 4 4 D 6 5 E 8 2 processtable-02.sim A 0 4 B 1 7 C 4 5 D 4 5 E 7 2 F 8 5 G 10 1 H 10 4 I 12 6 processtable-03.sim A 0 3 B 2 4 C 3 5 D 3 8 E 3 2 F 5 6 G 7 9 H 7 4 I 8 3
  • 16. J 8 5 K 8 4 L 10 6 Makefile all: p5sol p5: p5-start.cpp g++ -g $< -o [email protected] p5sol: p5-solution.cpp g++ -g $< -o p5 debug: p5-solution.cpp g++ -DDEBUG_BUILD=1 -g $< -o p5 p5test: ./p5 processtable-01.sim rr 1 > sim-01-rr-1.tst @diff -s -q sim-01-rr-1.tst sim-01-rr-1.res ./p5 processtable-01.sim rr 4 > sim-01-rr-4.tst @diff -s -q sim-01-rr-4.tst sim-01-rr-4.res ./p5 processtable-01.sim srt > sim-01-srt.tst @diff -s -q sim-01-srt.tst sim-01-srt.res ./p5 processtable-02.sim rr 1 > sim-02-rr-1.tst @diff -s -q sim-02-rr-1.tst sim-02-rr-1.res ./p5 processtable-02.sim rr 4 > sim-02-rr-4.tst @diff -s -q sim-02-rr-4.tst sim-02-rr-4.res ./p5 processtable-02.sim srt > sim-02-srt.tst @diff -s -q sim-02-srt.tst sim-02-srt.res ./p5 processtable-03.sim rr 1 > sim-03-rr-1.tst @diff -s -q sim-03-rr-1.tst sim-03-rr-1.res ./p5 processtable-03.sim rr 5 > sim-03-rr-5.tst @diff -s -q sim-03-rr-5.tst sim-03-rr-5.res
  • 17. ./p5 processtable-03.sim srt > sim-03-srt.tst @diff -s -q sim-03-srt.tst sim-03-srt.res @rm sim-01-rr-1.tst sim-01-rr-4.tst sim-01-srt.tst sim-02- rr-1.tst sim-02-rr-4.tst sim-02-srt.tst sim-03-rr-1.tst sim-03-rr- 5.tst sim-03-srt.tst p5zip: zip ../prog-05.zip p5-start.cpp prog-05.pdf processtable- 01.sim processtable-02.sim processtable-03.sim Makefile *.res p5solzip: zip ../prog-05-sol.zip p5-solution.cpp processtable-*.sim sim-*.res clean: rm -f p5 sim-*.tst core* *~ sim-01-rr-1.res sim-01-rr-4.res sim-01-srt.res sim-02-rr-1.res sim-02-rr-4.res sim-02-srt.res
  • 18. sim-03-rr-1.res sim-03-rr-5.res sim-03-srt.res Programming Assignment #5 CSci 430, Spring 2019 Dates: Assigned: Monday April 15, 2019 Due: Wednesday May 1, 2019 (before Midnight) Objectives: � Understand short-term process scheduling. � Work with data structures to implement a round-robin scheduler. � Look at e�ects of di�erent time slice quantum sizes on the round-robin scheduling algorithm. � Use C/C++ to implement vector and matrix data structures, get practice in creating and using such data structures in C/C++. Description:
  • 19. Our textbooks chapter 9 discusses several possible short-term process scheduling policies. In this programming assignment exercise we will implement two of the preemptive policies, the simple shortest remaining time policy (SRT) and the round-robin scheduler with preemptive time slicing. Your program will be given a simple input �le, indicating the process name, its arrival time and its total service time, the same as the process scheduling examples from our textbook in Table 9.4 and Figure 9.5. You will simulate the execution of the required schedulers. As in previous assignments, you program will need to work non-interactively and be callable from the command line. The program will be provided with the �le name of a �le with process information, in the format discussed below. Your program will also be given the time slicing quantum parameter it is to use for the simulation, if round-robin scheduling is selected. Your program will need to output the results of running the set of simulated processes using the selected scheduling policy with the indicated time slice for the round-robin scheduler. Your program will have to output its results exactly as shown below in the required output format. Your program will also need to calculate some summary statistics for the simulated processes, including the turnaround time and Tr/Ts ratio for each process, and the mean Tr and Tr/Ts values for the given simulation. Process simulation �le formats The �les with the information about the processes to be simulated are fairly simple, and have the same information that our textbook uses to illustrate the process
  • 20. scheduling examples. Each simulation �le contains multiple rows of data, where each row consists of the process name, its arrival time, and its service time. Here is an example: 1 A 0 3 B 2 6 C 4 4 D 6 5 E 8 2 This �le is named process-01.sim in the zip archive of �les I have given you to get started on this assignment. This is also the same set of processes and start/service times used for all of the examples in table 9.4 and �gure 9.5. Running Simulations As with previous assignments you are required to support using your simulation from the command line. Your program will take the name of the �le containing the process information �rst. The next parameter will be either 'rr' to perform round-robin scheduling, or 'srt' if shortest remaining time policy is to be simulated. Finally, a 3rd parameter will be supplied for the round-robin scheduler, the time slice quantum to use. An example of running your �nished
  • 21. program should look like this: $ ./p3 process-01.sim rr 4 A A A B B B B C C C C D D D D B B E E D Name Fnsh T_r T_r/T_s ---------------------- A 3 3 1 B 17 15 2.5 C 11 7 1.75 D 20 14 2.8 E 19 11 5.5 Here we are running the simulation using the set of process information given in the previous section and with a time slice quantum of 4. Required Output As shown above, your program must generate 2 bits of output. First of all, while running the simulation of the selected scheduling policy, you should display the process names in the order they are run. In the previous example, the sequence of scheduled/run processes was: A A A B B B B C C C C D D D D B B E E D This indicates that process A ran �rst (times 0, 1 and 2),
  • 22. followed by B running 4 times (times 3 to 7), etc. You are required to output the sequence of process runs as the �rst line of output, with a single space in between each process name as shown. After the processes have run, you need to calculate and display the statistics for the processes that you just simulated. In our previous example, the statistics for our round-robin simulation with a time quantum of 4 time slices were: Name Fnsh T_r T_r/T_s ---------------------- A 3 3 1 B 17 15 2.5 C 11 7 1.75 2 D 20 14 2.8 E 19 11 5.5 For each process, you need to output the time when it �nished, the turnaround time (Tr) and the ratio of the turnaround time to the service time (Tr/Ts). I have provided a zip �le with a �le named p3-start.cpp as a template to get you started. In addition, I have provided you with two process simulation �les, named
  • 23. process-01.sim and process-02.sim, with 2 sets of process information you can simulate. There are several examples of correct results generated for the two sets of inputs, named things like process-01-q1.res, process-01-q4.res, process-01-srt.res, etc. These are the correct results you should get for running your simulation with round-robin scheduling for various time quantums or for shortest remaining time scheduling. 3