mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 14:43:08 +02:00
chore: add lab 2 and lab 3
This commit is contained in:
parent
6c2529b264
commit
f38dce959c
92
EOPSY/lab2/README.md
Normal file
92
EOPSY/lab2/README.md
Normal file
@ -0,0 +1,92 @@
|
||||
# eopsy_KRZYSZTOF_RUDNICKI_lab2
|
||||
|
||||
|
||||
|
||||
## Getting started
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
|
||||
## Add your files
|
||||
|
||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin https://gitlab-stud.elka.pw.edu.pl/krudnic3/eopsy_krzysztof_rudnicki_lab2.git
|
||||
git branch -M main
|
||||
git push -uf origin main
|
||||
```
|
||||
|
||||
## Integrate with your tools
|
||||
|
||||
- [ ] [Set up project integrations](https://gitlab-stud.elka.pw.edu.pl/krudnic3/eopsy_krzysztof_rudnicki_lab2/-/settings/integrations)
|
||||
|
||||
## Collaborate with your team
|
||||
|
||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
||||
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
||||
|
||||
## Test and Deploy
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
|
||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
||||
|
||||
***
|
||||
|
||||
# Editing this README
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
|
||||
## Suggestions for a good README
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
||||
BIN
EOPSY/lab2/a.out
Executable file
BIN
EOPSY/lab2/a.out
Executable file
Binary file not shown.
BIN
EOPSY/lab2/tsig
Executable file
BIN
EOPSY/lab2/tsig
Executable file
Binary file not shown.
210
EOPSY/lab2/tsig.c
Normal file
210
EOPSY/lab2/tsig.c
Normal file
@ -0,0 +1,210 @@
|
||||
#include <stdio.h> // printf()
|
||||
#include <unistd.h> // fork()
|
||||
#include <time.h> // clock()
|
||||
#include <stdlib.h> // malloc()
|
||||
#include <signal.h> // sigaction(), SIGTERM
|
||||
#include <sys/wait.h> // wait()
|
||||
#define WITH_SIGNALS
|
||||
const int NUM_CHILD = 5;
|
||||
int KEYBOARD_INTERRUPT_MARK = 0;
|
||||
|
||||
|
||||
void ourOwnSigTermHandler()
|
||||
{
|
||||
printf("Process: %d was terminated\n", getpid());
|
||||
}
|
||||
|
||||
void childProcessAlgorithm()
|
||||
{
|
||||
#ifdef WITH_SIGNALS
|
||||
// 3.a in the child process
|
||||
struct sigaction ignoreSignal;
|
||||
ignoreSignal.sa_handler = SIG_IGN;
|
||||
sigaction(SIGTERM, &ignoreSignal, NULL); // ignore handling of the
|
||||
// keyboard interrupt signal
|
||||
struct sigaction sigTermHandler;
|
||||
sigTermHandler.sa_handler = ourOwnSigTermHandler;
|
||||
// set own handler of the sigterm signal, which will only
|
||||
// print a message of the termination of this process
|
||||
sigaction(SIGTERM, &sigTermHandler, NULL);
|
||||
#endif
|
||||
printf("Process identifier of parent process: %d \n", getppid());
|
||||
// print process identifier of the parent process
|
||||
sleep(10); // sleep for 10 seconds
|
||||
printf("Execution for child: %d complete! \n", getpid());
|
||||
// print a message about execution completion
|
||||
exit(0); // !exit from process!
|
||||
}
|
||||
|
||||
|
||||
void sendSIGTERMsignal(pid_t *children)
|
||||
{
|
||||
for(int i = 0; i < NUM_CHILD; i++) // go through each child
|
||||
{
|
||||
kill(children[i], SIGTERM); // and send sigterm signal using kill
|
||||
}
|
||||
}
|
||||
|
||||
void createChildProcesses(pid_t *children)
|
||||
{
|
||||
kill(-2, SIGTERM);
|
||||
for(int i = 0; i < NUM_CHILD; i++) // Create NUM_CHILD child processes
|
||||
{
|
||||
children[i] = fork(); // use the fork() function
|
||||
#ifdef WITH_SIGNALS
|
||||
// 3.c check the mark which may be set by the keyboard interrupt
|
||||
// handler
|
||||
if(KEYBOARD_INTERRUPT_MARK)
|
||||
{
|
||||
printf("interrupt of the creation process");
|
||||
// print a message about interrupt of the creation
|
||||
// process
|
||||
printf(" during creation of children[");
|
||||
printf("%d] = %d\n", i, children[i]);
|
||||
sendSIGTERMsignal(children);
|
||||
// signal all just created processes with the sigterm
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if(children[i] == 0) childProcessAlgorithm(); // child algorithm
|
||||
else
|
||||
{
|
||||
printf("fork for child[%d] failed! \n", i);
|
||||
kill(-2, SIGTERM); // -2 means that sigterm will be
|
||||
// sent to every process in the process group
|
||||
// whose id is -2
|
||||
}
|
||||
sleep(1); // insert one second delays between fork calls
|
||||
}
|
||||
}
|
||||
|
||||
int childProcessCorrect(const pid_t child)
|
||||
{
|
||||
return child >= 0; // -1 would mean that we could not create the child
|
||||
}
|
||||
|
||||
int correctChildProcesses(const pid_t *children)
|
||||
{
|
||||
for(int i = 0; i < NUM_CHILD; i++) // go through each child
|
||||
{
|
||||
if(!childProcessCorrect(children[i])) // check if it was created correctly
|
||||
{
|
||||
printf("children[%d] = %d", i, children[i]);
|
||||
// print approrpriate message that child was not created
|
||||
// correctly
|
||||
printf(", Was NOT declared correctly!\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void printCreationOfAllChildProcesses(const pid_t *children)
|
||||
{
|
||||
// print a message about creation of all child processes
|
||||
for(int i = 0; i < NUM_CHILD; i++)
|
||||
{
|
||||
printf("Process children[%d] = %d created \n", i, children[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void terminateChildren(pid_t *children)
|
||||
{
|
||||
int childTerminations = 0;
|
||||
for(int i = 0; i < NUM_CHILD; i++)
|
||||
{
|
||||
pid_t waitValue = wait(NULL); // call wait in loop
|
||||
if(waitValue != -1)
|
||||
{
|
||||
childTerminations++;
|
||||
// 2.4 count child processes terminations
|
||||
printf("Number of child processes terminations:");
|
||||
printf(" %d \n", childTerminations);
|
||||
}else
|
||||
{
|
||||
printf("Termination of the child %d", getpid());
|
||||
printf(" went wrong!\n");
|
||||
}
|
||||
}
|
||||
// 2.4 print a message that there are no more child processes
|
||||
printf("There are no more child processes \n");
|
||||
printf("Number of received child processes exit codes:");
|
||||
printf(" %d \n", childTerminations);
|
||||
// 2.4 priinta message with the number of just received child processes
|
||||
// exit codes
|
||||
}
|
||||
|
||||
int noSignalsVersion()
|
||||
{
|
||||
pid_t *children = malloc(sizeof(pid_t) * NUM_CHILD);
|
||||
// allocate space for all children
|
||||
|
||||
createChildProcesses(children); // create NUM_CHILD child processes
|
||||
if(!correctChildProcesses(children))
|
||||
{
|
||||
sendSIGTERMsignal(children); // if not send sigterm signals
|
||||
return 1;
|
||||
}
|
||||
printCreationOfAllChildProcesses(children);
|
||||
terminateChildren(children);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void ourOwnKeyboardInterrupt()
|
||||
{
|
||||
printf("Received keyboard interrupt \n");
|
||||
KEYBOARD_INTERRUPT_MARK = 1;
|
||||
}
|
||||
|
||||
int signalsVersion()
|
||||
{
|
||||
struct sigaction ignoreSignals;
|
||||
ignoreSignals.sa_handler = SIG_IGN;
|
||||
for(int i = 0; i < _NSIG; i++) // 3.a Go through every single possible signal
|
||||
{
|
||||
sigaction(i, &ignoreSignals, NULL); // 3.a and ignore it
|
||||
}
|
||||
|
||||
ignoreSignals.sa_handler = SIG_DFL; // Restore to default handler
|
||||
sigaction(SIGCHLD, &ignoreSignals, NULL); // 3.a the sigchld signal
|
||||
struct sigaction ownKeyboardInterrupt; // 3.b used to set our own
|
||||
// keyboard interrupt
|
||||
ownKeyboardInterrupt.sa_handler = ourOwnKeyboardInterrupt;
|
||||
// 3.c this function just prints info about receiving keyboard
|
||||
// interrupt and sets keyboard interrupt occurance global variable
|
||||
sigaction(SIGINT, &ownKeyboardInterrupt, NULL);
|
||||
// 3.c set it so that interruption by default uses ownKeyboardInterrupt
|
||||
pid_t *children = malloc(sizeof(pid_t) * NUM_CHILD);
|
||||
// allocate memory for children
|
||||
createChildProcesses(children);
|
||||
if(!correctChildProcesses(children))
|
||||
{
|
||||
sendSIGTERMsignal(children);
|
||||
return 1;
|
||||
}
|
||||
printCreationOfAllChildProcesses(children);
|
||||
terminateChildren(children);
|
||||
struct sigaction restoreSignals;
|
||||
ignoreSignals.sa_handler = SIG_DFL;
|
||||
for(int i = 0; i < _NSIG; i++)
|
||||
{
|
||||
// old service handlers of all signals should be restored
|
||||
sigaction(i, &restoreSignals, NULL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef WITH_SIGNALS
|
||||
printf("Entering NO signals version! \n");
|
||||
return noSignalsVersion();
|
||||
#endif
|
||||
#ifdef WITH_SIGNALS
|
||||
printf("Entering signals version! \n");
|
||||
signalsVersion();
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
199
EOPSY/lab3/report/README.tjk
Normal file
199
EOPSY/lab3/report/README.tjk
Normal file
@ -0,0 +1,199 @@
|
||||
|
||||
|
||||
WORKPLACE ORGANIZATION:
|
||||
mkdir ../work
|
||||
cd ../work
|
||||
cp ../ftp/* .
|
||||
gzip -d sched.tgz
|
||||
tar -xvf sched.tar
|
||||
rm sched.tar
|
||||
|
||||
|
||||
READING:
|
||||
less/vi README.tjk
|
||||
netscape/lynx install_unix.html
|
||||
netscape/lynx user_guide.html
|
||||
|
||||
|
||||
COMPILE:
|
||||
javac -nowarn *.java
|
||||
|
||||
|
||||
RUN:
|
||||
java Scheduling scheduling.conf
|
||||
|
||||
|
||||
FILES:
|
||||
input file name: scheduling.conf
|
||||
output file name: Summary-Processes
|
||||
log file name: Summary-Processes
|
||||
|
||||
|
||||
--[ YOUR TASK ]-------------------------------------------------------
|
||||
|
||||
Create a configuration file in which all processes run an average
|
||||
of 2000 milliseconds with a standard deviation of zero, and which
|
||||
are blocked for input or output every 500 milliseconds. Run the
|
||||
simulation for 10000 milliseconds with 2 processes. Examine the
|
||||
two output files. Try again for 5 processes. Try again for 10
|
||||
processes. Explain what's happening.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
The Configuration File
|
||||
|
||||
The configuration file (scheduling.conf) is used to specify various
|
||||
parameters for the simulation, including:
|
||||
* the number of processes,
|
||||
* the mean runtime for a process,
|
||||
* the standard deviation in runtime for a process,
|
||||
* for each process, how long the process runs before it blocks for
|
||||
input or output, and
|
||||
* how long the simulation should run.
|
||||
|
||||
Configuration File Options
|
||||
|
||||
There are a number of options which can be specified in the
|
||||
configuration file. These are summarized in the table below.
|
||||
|
||||
Keyword Values Description
|
||||
numprocess n The number of processes to create for the simulation.
|
||||
meandev n The average length of time in milliseconds that a process
|
||||
should execute before terminating.
|
||||
standdev n The number of standard deviations from the average length
|
||||
of time a process should execute before terminating.
|
||||
process n The amount of time in milliseconds that the process should
|
||||
execute before blocking for input or output. There should be a
|
||||
separate process directive for each process specified by the
|
||||
numprocess directive.
|
||||
runtime n The maximum amount of time the simulation should run in
|
||||
milliseconds.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Sample Configuration File
|
||||
|
||||
The "scheduling.conf" configuration file looks like this:
|
||||
|
||||
// # of Process
|
||||
numprocess 3
|
||||
|
||||
// mean deivation
|
||||
meandev 1100
|
||||
|
||||
// standard deviation
|
||||
standdev 510
|
||||
|
||||
// process # I/O blocking
|
||||
process 100
|
||||
process 500
|
||||
process 30
|
||||
|
||||
// duration of the simulation in milliseconds
|
||||
runtime 5000
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
The Summary-Results File
|
||||
|
||||
The Summary-Results file contains a summary report describing the
|
||||
simulation and includes one line of summary information for each
|
||||
process. The fields and columns in the report are described in the
|
||||
following table.
|
||||
|
||||
Field Description
|
||||
Scheduling Type: The type of the scheduling algorithm used. The value
|
||||
displayed is "hard coded" in the SchedulingAlgorithm.java file.
|
||||
Scheduling Name: The name of the scheduling algorithm used. The value
|
||||
displayed is "hard coded" in the SchedulingAlgorithm.java file.
|
||||
Simulation Run Time: The number of milliseconds that the simulation
|
||||
ran. This may be less than or equal to the total amount of time
|
||||
specified by the "runtime" configuration parameter.
|
||||
Mean: The average amount of runtime for the processes as specified by
|
||||
the "meandev" configuration parameter.
|
||||
Standard Deviation: The standard deviation from the average amount of
|
||||
runtime for the processes as specified by the "standdev" configuration
|
||||
parameter.
|
||||
Process # The process number assigned to the process by the simulator.
|
||||
The process number is between 0 and n-1, where n is the number
|
||||
specified by the "numprocess" configuration parameter.
|
||||
CPU Time The randomly generated total runtime for the process in
|
||||
milliseconds. This is determined by the "meandev" and "standdev"
|
||||
parameters in the configuration file.
|
||||
IO Blocking The amount of time the process runs before it blocks for
|
||||
input or output. This is specified for each process by a "process"
|
||||
directive in the configuration file.
|
||||
CPU Completed The amount of runtime in milliseconds completed for the
|
||||
process. Note that this may be less than the CPU Time for the process
|
||||
if the simulator runs out of time as specified by the "runtime"
|
||||
configuration parameter.
|
||||
CPU Blocked The number of times the process blocked for input or
|
||||
output during the simulation.
|
||||
|
||||
Sample Summary-Results File
|
||||
|
||||
The output "Summary-Results" file looks something like this:
|
||||
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 2750
|
||||
Mean: 1100
|
||||
Standard Deviation: 510
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 1372 (ms) 100 (ms) 1372 (ms) 13 times
|
||||
1 689 (ms) 500 (ms) 689 (ms) 1 times
|
||||
2 689 (ms) 30 (ms) 689 (ms) 22 times
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
The Summary-Processes File
|
||||
|
||||
The Summary-Processes file contains a log of the actions taken by the
|
||||
scheduling algorithm as it considers each process in the scheduling
|
||||
queue.
|
||||
|
||||
Each line in the log file is of the following form:
|
||||
|
||||
Process: process-number process-status... (cpu-time block-time accumulated-time
|
||||
accumulated-time)
|
||||
|
||||
The fields in the line are described in the table below.
|
||||
|
||||
Field Description
|
||||
process-number The process number assigned to the process by the
|
||||
simulator. This is a number between 0 and n-1, where n is the value
|
||||
specified for the "numprocess" configuration parameter.
|
||||
process-status The status of the process at this point in time. If
|
||||
"registered" then the process is under consideration by the scheduling
|
||||
algorithm. If "I/O blocked", then the scheduling algorithm has noticed
|
||||
that the process is blocked for input or output. If "completed", then
|
||||
the scheduling algorithm has noticed that the process has met or
|
||||
exceeded its allocated execution time.
|
||||
cpu-time The total amount of run time allowed for this process. This
|
||||
number is randomly generated for the process based on the "meandev"
|
||||
and "standdev" values specified in the configuration file.
|
||||
block-time The amount of time in milliseconds to execute before
|
||||
blocking process. This number is specified for the process by the
|
||||
"process" directive in the configuration file.
|
||||
accumulated-time The total amount of time process has executed in
|
||||
milliseconds. (This number appears twice in the log file; one should
|
||||
be removed).
|
||||
|
||||
Sample Summary-Processes File
|
||||
|
||||
The output "Summary-Processes" file looks something like this:
|
||||
|
||||
Process: 0 registered... (1372 100 0 0)
|
||||
Process: 0 I/O blocked... (1372 100 100 100)
|
||||
Process: 1 registered... (689 500 0 0)
|
||||
Process: 1 I/O blocked... (689 500 500 500)
|
||||
Process: 0 registered... (1372 100 100 100)
|
||||
Process: 0 I/O blocked... (1372 100 200 200)
|
||||
Process: 1 registered... (689 500 500 500)
|
||||
Process: 1 completed... (689 500 689 689)
|
||||
Process: 0 registered... (1372 100 200 200)
|
||||
Process: 0 I/O blocked... (1372 100 300 300)
|
||||
Process: 2 registered... (689 30 0 0)
|
||||
Process: 2 I/O blocked... (689 30 30 30)
|
||||
|
||||
39
EOPSY/lab3/report/processesfive
Normal file
39
EOPSY/lab3/report/processesfive
Normal file
@ -0,0 +1,39 @@
|
||||
Process: 0 registered... (2000 500 0 0)
|
||||
Process: 0 I/O blocked... (2000 500 500 500)
|
||||
Process: 1 registered... (2000 500 0 0)
|
||||
Process: 1 I/O blocked... (2000 500 500 500)
|
||||
Process: 0 registered... (2000 500 500 500)
|
||||
Process: 0 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 1 registered... (2000 500 500 500)
|
||||
Process: 1 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 0 registered... (2000 500 1000 1000)
|
||||
Process: 0 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 1 registered... (2000 500 1000 1000)
|
||||
Process: 1 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 0 registered... (2000 500 1500 1500)
|
||||
Process: 0 completed... (2000 500 2000 2000)
|
||||
Process: 1 registered... (2000 500 1500 1500)
|
||||
Process: 1 completed... (2000 500 2000 2000)
|
||||
Process: 2 registered... (2000 500 0 0)
|
||||
Process: 2 I/O blocked... (2000 500 500 500)
|
||||
Process: 3 registered... (2000 500 0 0)
|
||||
Process: 3 I/O blocked... (2000 500 500 500)
|
||||
Process: 2 registered... (2000 500 500 500)
|
||||
Process: 2 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 3 registered... (2000 500 500 500)
|
||||
Process: 3 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 2 registered... (2000 500 1000 1000)
|
||||
Process: 2 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 3 registered... (2000 500 1000 1000)
|
||||
Process: 3 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 2 registered... (2000 500 1500 1500)
|
||||
Process: 2 completed... (2000 500 2000 2000)
|
||||
Process: 3 registered... (2000 500 1500 1500)
|
||||
Process: 3 completed... (2000 500 2000 2000)
|
||||
Process: 4 registered... (2000 500 0 0)
|
||||
Process: 4 I/O blocked... (2000 500 500 500)
|
||||
Process: 4 registered... (2000 500 500 500)
|
||||
Process: 4 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 4 registered... (2000 500 1000 1000)
|
||||
Process: 4 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 4 registered... (2000 500 1500 1500)
|
||||
39
EOPSY/lab3/report/processesten
Normal file
39
EOPSY/lab3/report/processesten
Normal file
@ -0,0 +1,39 @@
|
||||
Process: 0 registered... (2000 500 0 0)
|
||||
Process: 0 I/O blocked... (2000 500 500 500)
|
||||
Process: 1 registered... (2000 500 0 0)
|
||||
Process: 1 I/O blocked... (2000 500 500 500)
|
||||
Process: 0 registered... (2000 500 500 500)
|
||||
Process: 0 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 1 registered... (2000 500 500 500)
|
||||
Process: 1 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 0 registered... (2000 500 1000 1000)
|
||||
Process: 0 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 1 registered... (2000 500 1000 1000)
|
||||
Process: 1 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 0 registered... (2000 500 1500 1500)
|
||||
Process: 0 completed... (2000 500 2000 2000)
|
||||
Process: 1 registered... (2000 500 1500 1500)
|
||||
Process: 1 completed... (2000 500 2000 2000)
|
||||
Process: 2 registered... (2000 500 0 0)
|
||||
Process: 2 I/O blocked... (2000 500 500 500)
|
||||
Process: 3 registered... (2000 500 0 0)
|
||||
Process: 3 I/O blocked... (2000 500 500 500)
|
||||
Process: 2 registered... (2000 500 500 500)
|
||||
Process: 2 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 3 registered... (2000 500 500 500)
|
||||
Process: 3 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 2 registered... (2000 500 1000 1000)
|
||||
Process: 2 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 3 registered... (2000 500 1000 1000)
|
||||
Process: 3 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 2 registered... (2000 500 1500 1500)
|
||||
Process: 2 completed... (2000 500 2000 2000)
|
||||
Process: 3 registered... (2000 500 1500 1500)
|
||||
Process: 3 completed... (2000 500 2000 2000)
|
||||
Process: 4 registered... (2000 500 0 0)
|
||||
Process: 4 I/O blocked... (2000 500 500 500)
|
||||
Process: 5 registered... (2000 500 0 0)
|
||||
Process: 5 I/O blocked... (2000 500 500 500)
|
||||
Process: 4 registered... (2000 500 500 500)
|
||||
Process: 4 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 5 registered... (2000 500 500 500)
|
||||
16
EOPSY/lab3/report/processestwo
Normal file
16
EOPSY/lab3/report/processestwo
Normal file
@ -0,0 +1,16 @@
|
||||
Process: 0 registered... (2000 500 0 0)
|
||||
Process: 0 I/O blocked... (2000 500 500 500)
|
||||
Process: 1 registered... (2000 500 0 0)
|
||||
Process: 1 I/O blocked... (2000 500 500 500)
|
||||
Process: 0 registered... (2000 500 500 500)
|
||||
Process: 0 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 1 registered... (2000 500 500 500)
|
||||
Process: 1 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 0 registered... (2000 500 1000 1000)
|
||||
Process: 0 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 1 registered... (2000 500 1000 1000)
|
||||
Process: 1 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 0 registered... (2000 500 1500 1500)
|
||||
Process: 0 completed... (2000 500 2000 2000)
|
||||
Process: 1 registered... (2000 500 1500 1500)
|
||||
Process: 1 completed... (2000 500 2000 2000)
|
||||
14
EOPSY/lab3/report/report.aux
Normal file
14
EOPSY/lab3/report/report.aux
Normal file
@ -0,0 +1,14 @@
|
||||
\relax
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {0.1}Scheduling conf settings}{1}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {0.2}Two processes}{1}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {0.2.1}Summary Results}{1}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {0.2.2}Summary Processes}{1}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {0.2.3}Comments}{2}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {0.3}Five processes}{2}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {0.3.1}Summary Results}{3}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {0.3.2}Summary Processes}{3}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {0.3.3}Comments}{4}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {0.4}Ten processes}{4}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {0.4.1}Summary Results}{4}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {0.4.2}Summary Processes}{5}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {0.4.3}Comments}{6}\protected@file@percent }
|
||||
26
EOPSY/lab3/report/report.fdb_latexmk
Normal file
26
EOPSY/lab3/report/report.fdb_latexmk
Normal file
@ -0,0 +1,26 @@
|
||||
# Fdb version 3
|
||||
["pdflatex"] 1651180479 "report.tex" "report.pdf" "report" 1651180479
|
||||
"/etc/texmf/web2c/texmf.cnf" 1649511474 475 c0e671620eb5563b2130f56340a5fde8 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map" 1577235249 3524 cb3e574dea2d1052e39280babc910dc8 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm" 1136768653 1324 c910af8c371558dc20f2d7822f66fe64 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm" 1136768653 1288 655e228510b4c2a1abe905c368440826 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb" 1248133631 32080 340ef9bf63678554ee606688e7b5339d ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb" 1248133631 35752 024fb6c41858982481f6968b5fc26508 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb" 1248133631 32569 5e5ddc8df908dea60932f3c484a54c0d ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/report.cls" 1580683321 23082 a0e9a5941c744eda6abe56770037a201 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo" 1580683321 8446 9874cccac5fee462272c582807dbbf56 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty" 1580683321 2590 e3b24ff953e5b58d924f163d25380312 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def" 1580854751 25404 9d60f463a00d154207ec0048dee27cf0 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg" 1568236792 1830 bbaba8afaf42cc048ec4d4ff73467521 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty" 1568236792 80511 830f3f1d3ab7448dd84233e9c2f6462c ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty" 1568236792 77022 32914f01b528131c47be2a1040d3856d ""
|
||||
"/usr/share/texlive/texmf-dist/web2c/texmf.cnf" 1581979058 38841 ce3692aa899bb693b90b87eaa5d4d84e ""
|
||||
"/usr/share/texmf/web2c/texmf.cnf" 1581979058 38841 ce3692aa899bb693b90b87eaa5d4d84e ""
|
||||
"/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map" 1649511498 4770781 1ed1abab22da9c3e2cc82e4db562318b ""
|
||||
"/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1649511522 8256308 efb305160d4d659dcd0c4df67bdfa340 ""
|
||||
"report.aux" 1651180479 1381 beb79f7f27071576b464b34c6342e7ba "pdflatex"
|
||||
"report.tex" 1651180479 9871 9cedac79a557d32619374a6bdf67fb9f ""
|
||||
(generated)
|
||||
"report.pdf"
|
||||
"report.log"
|
||||
"report.aux"
|
||||
35
EOPSY/lab3/report/report.fls
Normal file
35
EOPSY/lab3/report/report.fls
Normal file
@ -0,0 +1,35 @@
|
||||
PWD /home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EOPSY/eopsy_krzysztof_rudnicki_lab3/report
|
||||
INPUT /etc/texmf/web2c/texmf.cnf
|
||||
INPUT /usr/share/texmf/web2c/texmf.cnf
|
||||
INPUT /usr/share/texlive/texmf-dist/web2c/texmf.cnf
|
||||
INPUT /var/lib/texmf/web2c/pdftex/pdflatex.fmt
|
||||
INPUT report.tex
|
||||
OUTPUT report.log
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def
|
||||
INPUT report.aux
|
||||
INPUT report.aux
|
||||
OUTPUT report.aux
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm
|
||||
OUTPUT report.pdf
|
||||
INPUT /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map
|
||||
INPUT report.aux
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb
|
||||
95
EOPSY/lab3/report/report.log
Normal file
95
EOPSY/lab3/report/report.log
Normal file
@ -0,0 +1,95 @@
|
||||
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2022.4.9) 28 APR 2022 23:14
|
||||
entering extended mode
|
||||
restricted \write18 enabled.
|
||||
file:line:error style messages enabled.
|
||||
%&-line parsing enabled.
|
||||
**report.tex
|
||||
(./report.tex
|
||||
LaTeX2e <2020-02-02> patch level 2
|
||||
L3 programming layer <2020-02-14> (/usr/share/texlive/texmf-dist/tex/latex/base/report.cls
|
||||
Document Class: report 2019/12/20 v1.4l Standard LaTeX document class
|
||||
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
|
||||
File: size10.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
|
||||
)
|
||||
\c@part=\count167
|
||||
\c@chapter=\count168
|
||||
\c@section=\count169
|
||||
\c@subsection=\count170
|
||||
\c@subsubsection=\count171
|
||||
\c@paragraph=\count172
|
||||
\c@subparagraph=\count173
|
||||
\c@figure=\count174
|
||||
\c@table=\count175
|
||||
\abovecaptionskip=\skip47
|
||||
\belowcaptionskip=\skip48
|
||||
\bibindent=\dimen134
|
||||
) (/usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
|
||||
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
|
||||
\KV@toks@=\toks14
|
||||
)
|
||||
\lst@mode=\count176
|
||||
\lst@gtempboxa=\box45
|
||||
\lst@token=\toks15
|
||||
\lst@length=\count177
|
||||
\lst@currlwidth=\dimen135
|
||||
\lst@column=\count178
|
||||
\lst@pos=\count179
|
||||
\lst@lostspace=\dimen136
|
||||
\lst@width=\dimen137
|
||||
\lst@newlines=\count180
|
||||
\lst@lineno=\count181
|
||||
\lst@maxwidth=\dimen138
|
||||
(/usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty
|
||||
File: lstmisc.sty 2019/09/10 1.8c (Carsten Heinz)
|
||||
\c@lstnumber=\count182
|
||||
\lst@skipnumbers=\count183
|
||||
\lst@framebox=\box46
|
||||
) (/usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg
|
||||
File: listings.cfg 2019/09/10 1.8c listings configuration
|
||||
))
|
||||
Package: listings 2019/09/10 1.8c (Carsten Heinz)
|
||||
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def
|
||||
File: l3backend-pdfmode.def 2020-02-03 L3 backend support: PDF mode
|
||||
\l__kernel_color_stack_int=\count184
|
||||
\l__pdf_internal_box=\box47
|
||||
) (./report.aux)
|
||||
\openout1 = `report.aux'.
|
||||
|
||||
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 3.
|
||||
LaTeX Font Info: ... okay on input line 3.
|
||||
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 3.
|
||||
LaTeX Font Info: ... okay on input line 3.
|
||||
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 3.
|
||||
LaTeX Font Info: ... okay on input line 3.
|
||||
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 3.
|
||||
LaTeX Font Info: ... okay on input line 3.
|
||||
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 3.
|
||||
LaTeX Font Info: ... okay on input line 3.
|
||||
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3.
|
||||
LaTeX Font Info: ... okay on input line 3.
|
||||
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3.
|
||||
LaTeX Font Info: ... okay on input line 3.
|
||||
\c@lstlisting=\count185
|
||||
LaTeX Font Info: External font `cmex10' loaded for size
|
||||
(Font) <7> on input line 32.
|
||||
LaTeX Font Info: External font `cmex10' loaded for size
|
||||
(Font) <5> on input line 32.
|
||||
[1
|
||||
|
||||
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] [3] [4] [5] [6] (./report.aux) )
|
||||
Here is how much of TeX's memory you used:
|
||||
2015 strings out of 481239
|
||||
27819 string characters out of 5920378
|
||||
291741 words of memory out of 5000000
|
||||
17347 multiletter control sequences out of 15000+600000
|
||||
533548 words of font info for 28 fonts, out of 8000000 for 9000
|
||||
1141 hyphenation exceptions out of 8191
|
||||
28i,6n,36p,169b,1505s stack positions out of 5000i,500n,10000p,200000b,80000s
|
||||
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb>
|
||||
Output written on report.pdf (6 pages, 50576 bytes).
|
||||
PDF statistics:
|
||||
35 PDF objects out of 1000 (max. 8388607)
|
||||
23 compressed objects within 1 object stream
|
||||
0 named destinations out of 1000 (max. 500000)
|
||||
1 words of extra memory for PDF output out of 10000 (max. 10000000)
|
||||
|
||||
BIN
EOPSY/lab3/report/report.pdf
Normal file
BIN
EOPSY/lab3/report/report.pdf
Normal file
Binary file not shown.
BIN
EOPSY/lab3/report/report.synctex.gz
Normal file
BIN
EOPSY/lab3/report/report.synctex.gz
Normal file
Binary file not shown.
265
EOPSY/lab3/report/report.tex
Normal file
265
EOPSY/lab3/report/report.tex
Normal file
@ -0,0 +1,265 @@
|
||||
\documentclass{report}
|
||||
\usepackage{listings}
|
||||
\begin{document}
|
||||
|
||||
\section{Scheduling conf settings}
|
||||
\begin{lstlisting}
|
||||
// # of Process
|
||||
numprocess 2 or 5 or 10
|
||||
|
||||
// mean deivation
|
||||
meandev 2000
|
||||
|
||||
// standard deviation
|
||||
standdev 0
|
||||
|
||||
// process # I/O blocking
|
||||
process 500
|
||||
process 500
|
||||
(more if we set numprocess to 5 or 10)
|
||||
|
||||
// duration of the simulation in milliseconds
|
||||
runtime 10000
|
||||
|
||||
\end{lstlisting}
|
||||
|
||||
\section{Two processes}
|
||||
\subsection{Summary Results}
|
||||
|
||||
|
||||
\begin{lstlisting}
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 4000
|
||||
Mean: 2000
|
||||
Standard Deviation: 0
|
||||
\end{lstlisting}
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{| c | c | c | c | c |}
|
||||
\hline
|
||||
Process\# & CPU Time & IO Blocking & CPU Completed & CPU Blocked \\
|
||||
\hline
|
||||
0& 2000 (ms)& 500 (ms)& 2000 (ms)& 3 times \\
|
||||
\hline
|
||||
1& 2000 (ms)& 500 (ms)& 2000 (ms)& 3 times \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
\subsection{Summary Processes}
|
||||
\begin{lstlisting}
|
||||
Process: 0 registered... (2000 500 0 0)
|
||||
Process: 0 I/O blocked... (2000 500 500 500)
|
||||
Process: 1 registered... (2000 500 0 0)
|
||||
Process: 1 I/O blocked... (2000 500 500 500)
|
||||
Process: 0 registered... (2000 500 500 500)
|
||||
Process: 0 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 1 registered... (2000 500 500 500)
|
||||
Process: 1 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 0 registered... (2000 500 1000 1000)
|
||||
Process: 0 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 1 registered... (2000 500 1000 1000)
|
||||
Process: 1 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 0 registered... (2000 500 1500 1500)
|
||||
Process: 0 completed... (2000 500 2000 2000)
|
||||
Process: 1 registered... (2000 500 1500 1500)
|
||||
Process: 1 completed... (2000 500 2000 2000)
|
||||
\end{lstlisting}
|
||||
\subsection{Comments}
|
||||
Scheduling type was Batch since I did not change it in SchedulingAlgorithm.java
|
||||
file \\
|
||||
Scheduling Name was First-Come First-Served since this is what what we use as
|
||||
described in README for this laboratory \\
|
||||
Simulation Run time is 4000 ms and NOT 10000 ms since the simulation finished
|
||||
before it exceeded this max time \\
|
||||
Mean is 2000 since this is a value I set in conf value according to laboratory
|
||||
task description, same with standard deviation equal to 0 and CPU Time equal to
|
||||
2000 ms \\
|
||||
IO Blocking is equal to 500 ms, this is a value which we specified in
|
||||
configuration file and since we did not exceeded the runtime parameter it stayed
|
||||
equal to 500 ms \\
|
||||
CPU completed is equal to 2000 since this is deviation we set in configuration
|
||||
settings and the runtime was not exceeded \\
|
||||
All processes blocked 3 times, analysing summary processes we can see that they
|
||||
blocked at 500 ms, 1000 ms and 1500 ms and at 2000 seconds they completed
|
||||
|
||||
\section{Five processes}
|
||||
\newpage
|
||||
\subsection{Summary Results}
|
||||
\begin{lstlisting}
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 10000
|
||||
Mean: 2000
|
||||
Standard Deviation: 0
|
||||
\end{lstlisting}
|
||||
\begin{center}
|
||||
\begin{tabular}{| c | c | c | c | c |}
|
||||
\hline
|
||||
Process\# & CPU Time & IO Blocking & CPU Completed & CPU Blocked \\
|
||||
\hline
|
||||
0& 2000 (ms)& 500 (ms)& 2000 (ms)& 3 times \\
|
||||
\hline
|
||||
1& 2000 (ms)& 500 (ms)& 2000 (ms)& 3 times \\
|
||||
\hline
|
||||
2& 2000 (ms)& 500 (ms)& 2000 (ms)& 3 times \\
|
||||
\hline
|
||||
3& 2000 (ms)& 500 (ms)& 2000 (ms)& 3 times \\
|
||||
\hline
|
||||
4& 2000 (ms)& 500 (ms)& 2000 (ms)& 3 times \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
\subsection{Summary Processes}
|
||||
\begin{lstlisting}
|
||||
Process: 0 registered... (2000 500 0 0)
|
||||
Process: 0 I/O blocked... (2000 500 500 500)
|
||||
Process: 1 registered... (2000 500 0 0)
|
||||
Process: 1 I/O blocked... (2000 500 500 500)
|
||||
Process: 0 registered... (2000 500 500 500)
|
||||
Process: 0 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 1 registered... (2000 500 500 500)
|
||||
Process: 1 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 0 registered... (2000 500 1000 1000)
|
||||
Process: 0 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 1 registered... (2000 500 1000 1000)
|
||||
Process: 1 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 0 registered... (2000 500 1500 1500)
|
||||
Process: 0 completed... (2000 500 2000 2000)
|
||||
Process: 1 registered... (2000 500 1500 1500)
|
||||
Process: 1 completed... (2000 500 2000 2000)
|
||||
Process: 2 registered... (2000 500 0 0)
|
||||
Process: 2 I/O blocked... (2000 500 500 500)
|
||||
Process: 3 registered... (2000 500 0 0)
|
||||
Process: 3 I/O blocked... (2000 500 500 500)
|
||||
Process: 2 registered... (2000 500 500 500)
|
||||
Process: 2 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 3 registered... (2000 500 500 500)
|
||||
Process: 3 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 2 registered... (2000 500 1000 1000)
|
||||
Process: 2 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 3 registered... (2000 500 1000 1000)
|
||||
Process: 3 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 2 registered... (2000 500 1500 1500)
|
||||
Process: 2 completed... (2000 500 2000 2000)
|
||||
Process: 3 registered... (2000 500 1500 1500)
|
||||
Process: 3 completed... (2000 500 2000 2000)
|
||||
Process: 4 registered... (2000 500 0 0)
|
||||
Process: 4 I/O blocked... (2000 500 500 500)
|
||||
Process: 4 registered... (2000 500 500 500)
|
||||
Process: 4 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 4 registered... (2000 500 1000 1000)
|
||||
Process: 4 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 4 registered... (2000 500 1500 1500)
|
||||
\end{lstlisting}
|
||||
\subsection{Comments}
|
||||
Scheduling type was Batch since I did not change it in SchedulingAlgorithm.java
|
||||
file \\
|
||||
Scheduling Name was First-Come First-Served since this is what what we use as
|
||||
described in README for this laboratory \\
|
||||
Simulation run time is 10000 ms since it run untill the limit I set in conf file
|
||||
according to task description \\
|
||||
CPU blocking is set everywhere to 500 ms as in conf file \\
|
||||
Mean is 2000 since this is a value I set in conf value according to laboratory
|
||||
task description, same with standard deviation equal to 0 and CPU Time equal to
|
||||
2000 ms \\
|
||||
CPU completed is equal to expected 2000 ms, this makes sense since we had run
|
||||
time equal to 10000 ms and 5 procesess so each of them could take exactly the
|
||||
amonunt of time we set them to take.
|
||||
|
||||
|
||||
\section{Ten processes}
|
||||
\subsection{Summary Results}
|
||||
\begin{lstlisting}
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 10000
|
||||
Mean: 2000
|
||||
Standard Deviation: 0
|
||||
\end{lstlisting}
|
||||
\begin{center}
|
||||
\begin{tabular}{| c | c | c | c | c |}
|
||||
\hline
|
||||
Process\# & CPU Time & IO Blocking & CPU Completed & CPU Blocked \\
|
||||
\hline
|
||||
0 &2000 (ms) &500 (ms)& 2000 (ms)& 3 times \\
|
||||
\hline
|
||||
1 &2000 (ms) &500 (ms)& 2000 (ms)& 3 times \\
|
||||
\hline
|
||||
2 &2000 (ms) &500 (ms)& 2000 (ms)& 3 times \\
|
||||
\hline
|
||||
3 &2000 (ms) &500 (ms)& 2000 (ms)& 3 times \\
|
||||
\hline
|
||||
4 &2000 (ms) &500 (ms)& 1000 (ms)& 2 times \\
|
||||
\hline
|
||||
5 &2000 (ms) &500 (ms)& 1000 (ms)& 1 times \\
|
||||
\hline
|
||||
6 &2000 (ms) &500 (ms)& 0 (ms)& 0 times \\
|
||||
\hline
|
||||
7 &2000 (ms) &500 (ms)& 0 (ms)& 0 times \\
|
||||
\hline
|
||||
8 &2000 (ms) &500 (ms)& 0 (ms)& 0 times \\
|
||||
\hline
|
||||
9 &2000 (ms) &500 (ms)& 0 (ms)& 0 times \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\subsection{Summary Processes}
|
||||
\begin{lstlisting}
|
||||
Process: 0 registered... (2000 500 0 0)
|
||||
Process: 0 I/O blocked... (2000 500 500 500)
|
||||
Process: 1 registered... (2000 500 0 0)
|
||||
Process: 1 I/O blocked... (2000 500 500 500)
|
||||
Process: 0 registered... (2000 500 500 500)
|
||||
Process: 0 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 1 registered... (2000 500 500 500)
|
||||
Process: 1 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 0 registered... (2000 500 1000 1000)
|
||||
Process: 0 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 1 registered... (2000 500 1000 1000)
|
||||
Process: 1 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 0 registered... (2000 500 1500 1500)
|
||||
Process: 0 completed... (2000 500 2000 2000)
|
||||
Process: 1 registered... (2000 500 1500 1500)
|
||||
Process: 1 completed... (2000 500 2000 2000)
|
||||
Process: 2 registered... (2000 500 0 0)
|
||||
Process: 2 I/O blocked... (2000 500 500 500)
|
||||
Process: 3 registered... (2000 500 0 0)
|
||||
Process: 3 I/O blocked... (2000 500 500 500)
|
||||
Process: 2 registered... (2000 500 500 500)
|
||||
Process: 2 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 3 registered... (2000 500 500 500)
|
||||
Process: 3 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 2 registered... (2000 500 1000 1000)
|
||||
Process: 2 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 3 registered... (2000 500 1000 1000)
|
||||
Process: 3 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 2 registered... (2000 500 1500 1500)
|
||||
Process: 2 completed... (2000 500 2000 2000)
|
||||
Process: 3 registered... (2000 500 1500 1500)
|
||||
Process: 3 completed... (2000 500 2000 2000)
|
||||
Process: 4 registered... (2000 500 0 0)
|
||||
Process: 4 I/O blocked... (2000 500 500 500)
|
||||
Process: 5 registered... (2000 500 0 0)
|
||||
Process: 5 I/O blocked... (2000 500 500 500)
|
||||
Process: 4 registered... (2000 500 500 500)
|
||||
Process: 4 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 5 registered... (2000 500 500 500)
|
||||
\end{lstlisting}
|
||||
\subsection{Comments}
|
||||
Scheduling type was Batch since I did not change it in SchedulingAlgorithm.java
|
||||
file \\
|
||||
Scheduling Name was First-Come First-Served since this is what what we use as
|
||||
described in README for this laboratory \\
|
||||
Simulation run time is 10000 ms since it run untill the limit I set in conf file
|
||||
according to task description \\
|
||||
IO Blocking set to 500 ms as in config file \\
|
||||
Mean is 2000 since this is a value I set in conf value according to laboratory
|
||||
task description, same with standard deviation equal to 0 and CPU Time equal to
|
||||
2000 ms \\
|
||||
CPU completed this time is equal to 2000 up to 4th process and then is equal to
|
||||
1000 ms for 5th and 6th and then it is equal to 0 ms, this means that the
|
||||
simulation exceeded the runtime before it had a chance to run all processes
|
||||
\end{document}
|
||||
11
EOPSY/lab3/report/resultsfive
Normal file
11
EOPSY/lab3/report/resultsfive
Normal file
@ -0,0 +1,11 @@
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 10000
|
||||
Mean: 2000
|
||||
Standard Deviation: 0
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
1 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
2 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
3 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
4 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
16
EOPSY/lab3/report/resultsten
Normal file
16
EOPSY/lab3/report/resultsten
Normal file
@ -0,0 +1,16 @@
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 10000
|
||||
Mean: 2000
|
||||
Standard Deviation: 0
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
1 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
2 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
3 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
4 2000 (ms) 500 (ms) 1000 (ms) 2 times
|
||||
5 2000 (ms) 500 (ms) 1000 (ms) 1 times
|
||||
6 2000 (ms) 500 (ms) 0 (ms) 0 times
|
||||
7 2000 (ms) 500 (ms) 0 (ms) 0 times
|
||||
8 2000 (ms) 500 (ms) 0 (ms) 0 times
|
||||
9 2000 (ms) 500 (ms) 0 (ms) 0 times
|
||||
8
EOPSY/lab3/report/resultstwo
Normal file
8
EOPSY/lab3/report/resultstwo
Normal file
@ -0,0 +1,8 @@
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 4000
|
||||
Mean: 2000
|
||||
Standard Deviation: 0
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
1 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
6
EOPSY/lab3/report/texput.fls
Normal file
6
EOPSY/lab3/report/texput.fls
Normal file
@ -0,0 +1,6 @@
|
||||
PWD /home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EOPSY/eopsy_krzysztof_rudnicki_lab3/report
|
||||
INPUT /etc/texmf/web2c/texmf.cnf
|
||||
INPUT /usr/share/texmf/web2c/texmf.cnf
|
||||
INPUT /usr/share/texlive/texmf-dist/web2c/texmf.cnf
|
||||
INPUT /var/lib/texmf/web2c/pdftex/pdflatex.fmt
|
||||
OUTPUT texput.log
|
||||
22
EOPSY/lab3/report/texput.log
Normal file
22
EOPSY/lab3/report/texput.log
Normal file
@ -0,0 +1,22 @@
|
||||
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2022.4.9) 28 APR 2022 22:05
|
||||
entering extended mode
|
||||
restricted \write18 enabled.
|
||||
file:line:error style messages enabled.
|
||||
%&-line parsing enabled.
|
||||
**report.tex
|
||||
|
||||
! Emergency stop.
|
||||
<*> report.tex
|
||||
|
||||
*** (job aborted, file error in nonstop mode)
|
||||
|
||||
|
||||
Here is how much of TeX's memory you used:
|
||||
3 strings out of 481239
|
||||
108 string characters out of 5920378
|
||||
236564 words of memory out of 5000000
|
||||
15373 multiletter control sequences out of 15000+600000
|
||||
532338 words of font info for 24 fonts, out of 8000000 for 9000
|
||||
1141 hyphenation exceptions out of 8191
|
||||
0i,0n,0p,1b,6s stack positions out of 5000i,500n,10000p,200000b,80000s
|
||||
! ==> Fatal error occurred, no output PDF file produced!
|
||||
1
EOPSY/lab3/task3/README
Normal file
1
EOPSY/lab3/task3/README
Normal file
@ -0,0 +1 @@
|
||||
Change directory to ./ftp and submit "make setup".
|
||||
39
EOPSY/lab3/task3/Summary-Processes
Normal file
39
EOPSY/lab3/task3/Summary-Processes
Normal file
@ -0,0 +1,39 @@
|
||||
Process: 0 registered... (2000 500 0 0)
|
||||
Process: 0 I/O blocked... (2000 500 500 500)
|
||||
Process: 1 registered... (2000 500 0 0)
|
||||
Process: 1 I/O blocked... (2000 500 500 500)
|
||||
Process: 0 registered... (2000 500 500 500)
|
||||
Process: 0 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 1 registered... (2000 500 500 500)
|
||||
Process: 1 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 0 registered... (2000 500 1000 1000)
|
||||
Process: 0 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 1 registered... (2000 500 1000 1000)
|
||||
Process: 1 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 0 registered... (2000 500 1500 1500)
|
||||
Process: 0 completed... (2000 500 2000 2000)
|
||||
Process: 1 registered... (2000 500 1500 1500)
|
||||
Process: 1 completed... (2000 500 2000 2000)
|
||||
Process: 2 registered... (2000 500 0 0)
|
||||
Process: 2 I/O blocked... (2000 500 500 500)
|
||||
Process: 3 registered... (2000 500 0 0)
|
||||
Process: 3 I/O blocked... (2000 500 500 500)
|
||||
Process: 2 registered... (2000 500 500 500)
|
||||
Process: 2 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 3 registered... (2000 500 500 500)
|
||||
Process: 3 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 2 registered... (2000 500 1000 1000)
|
||||
Process: 2 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 3 registered... (2000 500 1000 1000)
|
||||
Process: 3 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 2 registered... (2000 500 1500 1500)
|
||||
Process: 2 completed... (2000 500 2000 2000)
|
||||
Process: 3 registered... (2000 500 1500 1500)
|
||||
Process: 3 completed... (2000 500 2000 2000)
|
||||
Process: 4 registered... (2000 500 0 0)
|
||||
Process: 4 I/O blocked... (2000 500 500 500)
|
||||
Process: 4 registered... (2000 500 500 500)
|
||||
Process: 4 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 4 registered... (2000 500 1000 1000)
|
||||
Process: 4 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 4 registered... (2000 500 1500 1500)
|
||||
11
EOPSY/lab3/task3/Summary-Results
Normal file
11
EOPSY/lab3/task3/Summary-Results
Normal file
@ -0,0 +1,11 @@
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 10000
|
||||
Mean: 2000
|
||||
Standard Deviation: 0
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
1 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
2 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
3 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
4 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
24
EOPSY/lab3/task3/ftp/Makefile
Normal file
24
EOPSY/lab3/task3/ftp/Makefile
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
default: info
|
||||
|
||||
|
||||
help:
|
||||
less README.tjk
|
||||
|
||||
compile:
|
||||
javac -nowarn *.java
|
||||
|
||||
run:
|
||||
java Scheduling scheduling.conf
|
||||
|
||||
setup:
|
||||
./setUp
|
||||
|
||||
info:
|
||||
@echo ""
|
||||
@echo "Use 'make' with one argument:"
|
||||
@echo ""
|
||||
@echo " make help"
|
||||
@echo " make compile"
|
||||
@echo " make run"
|
||||
@echo ""
|
||||
199
EOPSY/lab3/task3/ftp/README.tjk
Normal file
199
EOPSY/lab3/task3/ftp/README.tjk
Normal file
@ -0,0 +1,199 @@
|
||||
|
||||
|
||||
WORKPLACE ORGANIZATION:
|
||||
mkdir ../work
|
||||
cd ../work
|
||||
cp ../ftp/* .
|
||||
gzip -d sched.tgz
|
||||
tar -xvf sched.tar
|
||||
rm sched.tar
|
||||
|
||||
|
||||
READING:
|
||||
less/vi README.tjk
|
||||
netscape/lynx install_unix.html
|
||||
netscape/lynx user_guide.html
|
||||
|
||||
|
||||
COMPILE:
|
||||
javac -nowarn *.java
|
||||
|
||||
|
||||
RUN:
|
||||
java Scheduling scheduling.conf
|
||||
|
||||
|
||||
FILES:
|
||||
input file name: scheduling.conf
|
||||
output file name: Summary-Processes
|
||||
log file name: Summary-Processes
|
||||
|
||||
|
||||
--[ YOUR TASK ]-------------------------------------------------------
|
||||
|
||||
Create a configuration file in which all processes run an average
|
||||
of 2000 milliseconds with a standard deviation of zero, and which
|
||||
are blocked for input or output every 500 milliseconds. Run the
|
||||
simulation for 10000 milliseconds with 2 processes. Examine the
|
||||
two output files. Try again for 5 processes. Try again for 10
|
||||
processes. Explain what's happening.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
The Configuration File
|
||||
|
||||
The configuration file (scheduling.conf) is used to specify various
|
||||
parameters for the simulation, including:
|
||||
* the number of processes,
|
||||
* the mean runtime for a process,
|
||||
* the standard deviation in runtime for a process,
|
||||
* for each process, how long the process runs before it blocks for
|
||||
input or output, and
|
||||
* how long the simulation should run.
|
||||
|
||||
Configuration File Options
|
||||
|
||||
There are a number of options which can be specified in the
|
||||
configuration file. These are summarized in the table below.
|
||||
|
||||
Keyword Values Description
|
||||
numprocess n The number of processes to create for the simulation.
|
||||
meandev n The average length of time in milliseconds that a process
|
||||
should execute before terminating.
|
||||
standdev n The number of standard deviations from the average length
|
||||
of time a process should execute before terminating.
|
||||
process n The amount of time in milliseconds that the process should
|
||||
execute before blocking for input or output. There should be a
|
||||
separate process directive for each process specified by the
|
||||
numprocess directive.
|
||||
runtime n The maximum amount of time the simulation should run in
|
||||
milliseconds.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Sample Configuration File
|
||||
|
||||
The "scheduling.conf" configuration file looks like this:
|
||||
|
||||
// # of Process
|
||||
numprocess 3
|
||||
|
||||
// mean deivation
|
||||
meandev 1100
|
||||
|
||||
// standard deviation
|
||||
standdev 510
|
||||
|
||||
// process # I/O blocking
|
||||
process 100
|
||||
process 500
|
||||
process 30
|
||||
|
||||
// duration of the simulation in milliseconds
|
||||
runtime 5000
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
The Summary-Results File
|
||||
|
||||
The Summary-Results file contains a summary report describing the
|
||||
simulation and includes one line of summary information for each
|
||||
process. The fields and columns in the report are described in the
|
||||
following table.
|
||||
|
||||
Field Description
|
||||
Scheduling Type: The type of the scheduling algorithm used. The value
|
||||
displayed is "hard coded" in the SchedulingAlgorithm.java file.
|
||||
Scheduling Name: The name of the scheduling algorithm used. The value
|
||||
displayed is "hard coded" in the SchedulingAlgorithm.java file.
|
||||
Simulation Run Time: The number of milliseconds that the simulation
|
||||
ran. This may be less than or equal to the total amount of time
|
||||
specified by the "runtime" configuration parameter.
|
||||
Mean: The average amount of runtime for the processes as specified by
|
||||
the "meandev" configuration parameter.
|
||||
Standard Deviation: The standard deviation from the average amount of
|
||||
runtime for the processes as specified by the "standdev" configuration
|
||||
parameter.
|
||||
Process # The process number assigned to the process by the simulator.
|
||||
The process number is between 0 and n-1, where n is the number
|
||||
specified by the "numprocess" configuration parameter.
|
||||
CPU Time The randomly generated total runtime for the process in
|
||||
milliseconds. This is determined by the "meandev" and "standdev"
|
||||
parameters in the configuration file.
|
||||
IO Blocking The amount of time the process runs before it blocks for
|
||||
input or output. This is specified for each process by a "process"
|
||||
directive in the configuration file.
|
||||
CPU Completed The amount of runtime in milliseconds completed for the
|
||||
process. Note that this may be less than the CPU Time for the process
|
||||
if the simulator runs out of time as specified by the "runtime"
|
||||
configuration parameter.
|
||||
CPU Blocked The number of times the process blocked for input or
|
||||
output during the simulation.
|
||||
|
||||
Sample Summary-Results File
|
||||
|
||||
The output "Summary-Results" file looks something like this:
|
||||
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 2750
|
||||
Mean: 1100
|
||||
Standard Deviation: 510
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 1372 (ms) 100 (ms) 1372 (ms) 13 times
|
||||
1 689 (ms) 500 (ms) 689 (ms) 1 times
|
||||
2 689 (ms) 30 (ms) 689 (ms) 22 times
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
The Summary-Processes File
|
||||
|
||||
The Summary-Processes file contains a log of the actions taken by the
|
||||
scheduling algorithm as it considers each process in the scheduling
|
||||
queue.
|
||||
|
||||
Each line in the log file is of the following form:
|
||||
|
||||
Process: process-number process-status... (cpu-time block-time accumulated-time
|
||||
accumulated-time)
|
||||
|
||||
The fields in the line are described in the table below.
|
||||
|
||||
Field Description
|
||||
process-number The process number assigned to the process by the
|
||||
simulator. This is a number between 0 and n-1, where n is the value
|
||||
specified for the "numprocess" configuration parameter.
|
||||
process-status The status of the process at this point in time. If
|
||||
"registered" then the process is under consideration by the scheduling
|
||||
algorithm. If "I/O blocked", then the scheduling algorithm has noticed
|
||||
that the process is blocked for input or output. If "completed", then
|
||||
the scheduling algorithm has noticed that the process has met or
|
||||
exceeded its allocated execution time.
|
||||
cpu-time The total amount of run time allowed for this process. This
|
||||
number is randomly generated for the process based on the "meandev"
|
||||
and "standdev" values specified in the configuration file.
|
||||
block-time The amount of time in milliseconds to execute before
|
||||
blocking process. This number is specified for the process by the
|
||||
"process" directive in the configuration file.
|
||||
accumulated-time The total amount of time process has executed in
|
||||
milliseconds. (This number appears twice in the log file; one should
|
||||
be removed).
|
||||
|
||||
Sample Summary-Processes File
|
||||
|
||||
The output "Summary-Processes" file looks something like this:
|
||||
|
||||
Process: 0 registered... (1372 100 0 0)
|
||||
Process: 0 I/O blocked... (1372 100 100 100)
|
||||
Process: 1 registered... (689 500 0 0)
|
||||
Process: 1 I/O blocked... (689 500 500 500)
|
||||
Process: 0 registered... (1372 100 100 100)
|
||||
Process: 0 I/O blocked... (1372 100 200 200)
|
||||
Process: 1 registered... (689 500 500 500)
|
||||
Process: 1 completed... (689 500 689 689)
|
||||
Process: 0 registered... (1372 100 200 200)
|
||||
Process: 0 I/O blocked... (1372 100 300 300)
|
||||
Process: 2 registered... (689 30 0 0)
|
||||
Process: 2 I/O blocked... (689 30 30 30)
|
||||
|
||||
BIN
EOPSY/lab3/task3/ftp/sched.tgz
Normal file
BIN
EOPSY/lab3/task3/ftp/sched.tgz
Normal file
Binary file not shown.
9
EOPSY/lab3/task3/ftp/setUp
Executable file
9
EOPSY/lab3/task3/ftp/setUp
Executable file
@ -0,0 +1,9 @@
|
||||
echo "Creating ../work subdirectory"
|
||||
mkdir ../work
|
||||
cd ../work
|
||||
cp ../ftp/* .
|
||||
gzip -d sched.tgz
|
||||
tar -xvf sched.tar
|
||||
rm sched.tar
|
||||
echo ""
|
||||
echo "Now, go to the directory ../work and call 'make'"
|
||||
4067
EOPSY/lab3/task3/processesfive
Normal file
4067
EOPSY/lab3/task3/processesfive
Normal file
File diff suppressed because it is too large
Load Diff
149
EOPSY/lab3/task3/processesten
Normal file
149
EOPSY/lab3/task3/processesten
Normal file
@ -0,0 +1,149 @@
|
||||
Process: 0 registered... (2000 500 0 0)
|
||||
Process: 0 I/O blocked... (2000 500 500 500)
|
||||
Process: 1 registered... (2000 500 0 0)
|
||||
Process: 1 I/O blocked... (2000 500 500 500)
|
||||
Process: 0 registered... (2000 500 500 500)
|
||||
Process: 0 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 1 registered... (2000 500 500 500)
|
||||
Process: 1 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 0 registered... (2000 500 1000 1000)
|
||||
Process: 0 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 1 registered... (2000 500 1000 1000)
|
||||
Process: 1 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 0 registered... (2000 500 1500 1500)
|
||||
Process: 0 completed... (2000 500 2000 2000)
|
||||
Process: 1 registered... (2000 500 1500 1500)
|
||||
Process: 1 completed... (2000 500 2000 2000)
|
||||
Process: 2 registered... (2000 500 0 0)
|
||||
Process: 2 I/O blocked... (2000 500 500 500)
|
||||
Process: 3 registered... (2000 0 0 0)
|
||||
Process: 3 I/O blocked... (2000 0 1 1)
|
||||
Process: 2 registered... (2000 500 500 500)
|
||||
Process: 2 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 3 registered... (2000 0 1 1)
|
||||
Process: 3 I/O blocked... (2000 0 2 2)
|
||||
Process: 2 registered... (2000 500 1000 1000)
|
||||
Process: 2 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 3 registered... (2000 0 2 2)
|
||||
Process: 3 I/O blocked... (2000 0 3 3)
|
||||
Process: 2 registered... (2000 500 1500 1500)
|
||||
Process: 2 completed... (2000 500 2000 2000)
|
||||
Process: 3 registered... (2000 0 3 3)
|
||||
Process: 3 I/O blocked... (2000 0 3 3)
|
||||
Process: 4 registered... (2000 100 0 0)
|
||||
Process: 4 I/O blocked... (2000 100 100 100)
|
||||
Process: 3 registered... (2000 0 3 3)
|
||||
Process: 3 I/O blocked... (2000 0 4 4)
|
||||
Process: 4 registered... (2000 100 100 100)
|
||||
Process: 4 I/O blocked... (2000 100 200 200)
|
||||
Process: 3 registered... (2000 0 4 4)
|
||||
Process: 3 I/O blocked... (2000 0 5 5)
|
||||
Process: 4 registered... (2000 100 200 200)
|
||||
Process: 4 I/O blocked... (2000 100 300 300)
|
||||
Process: 3 registered... (2000 0 5 5)
|
||||
Process: 3 I/O blocked... (2000 0 6 6)
|
||||
Process: 4 registered... (2000 100 300 300)
|
||||
Process: 4 I/O blocked... (2000 100 400 400)
|
||||
Process: 3 registered... (2000 0 6 6)
|
||||
Process: 3 I/O blocked... (2000 0 7 7)
|
||||
Process: 4 registered... (2000 100 400 400)
|
||||
Process: 4 I/O blocked... (2000 100 500 500)
|
||||
Process: 3 registered... (2000 0 7 7)
|
||||
Process: 3 I/O blocked... (2000 0 8 8)
|
||||
Process: 4 registered... (2000 100 500 500)
|
||||
Process: 4 I/O blocked... (2000 100 600 600)
|
||||
Process: 3 registered... (2000 0 8 8)
|
||||
Process: 3 I/O blocked... (2000 0 9 9)
|
||||
Process: 4 registered... (2000 100 600 600)
|
||||
Process: 4 I/O blocked... (2000 100 700 700)
|
||||
Process: 3 registered... (2000 0 9 9)
|
||||
Process: 3 I/O blocked... (2000 0 10 10)
|
||||
Process: 4 registered... (2000 100 700 700)
|
||||
Process: 4 I/O blocked... (2000 100 800 800)
|
||||
Process: 3 registered... (2000 0 10 10)
|
||||
Process: 3 I/O blocked... (2000 0 11 11)
|
||||
Process: 4 registered... (2000 100 800 800)
|
||||
Process: 4 I/O blocked... (2000 100 900 900)
|
||||
Process: 3 registered... (2000 0 11 11)
|
||||
Process: 3 I/O blocked... (2000 0 12 12)
|
||||
Process: 4 registered... (2000 100 900 900)
|
||||
Process: 4 I/O blocked... (2000 100 1000 1000)
|
||||
Process: 3 registered... (2000 0 12 12)
|
||||
Process: 3 I/O blocked... (2000 0 13 13)
|
||||
Process: 4 registered... (2000 100 1000 1000)
|
||||
Process: 4 I/O blocked... (2000 100 1100 1100)
|
||||
Process: 3 registered... (2000 0 13 13)
|
||||
Process: 3 I/O blocked... (2000 0 14 14)
|
||||
Process: 4 registered... (2000 100 1100 1100)
|
||||
Process: 4 I/O blocked... (2000 100 1200 1200)
|
||||
Process: 3 registered... (2000 0 14 14)
|
||||
Process: 3 I/O blocked... (2000 0 15 15)
|
||||
Process: 4 registered... (2000 100 1200 1200)
|
||||
Process: 4 I/O blocked... (2000 100 1300 1300)
|
||||
Process: 3 registered... (2000 0 15 15)
|
||||
Process: 3 I/O blocked... (2000 0 16 16)
|
||||
Process: 4 registered... (2000 100 1300 1300)
|
||||
Process: 4 I/O blocked... (2000 100 1400 1400)
|
||||
Process: 3 registered... (2000 0 16 16)
|
||||
Process: 3 I/O blocked... (2000 0 17 17)
|
||||
Process: 4 registered... (2000 100 1400 1400)
|
||||
Process: 4 I/O blocked... (2000 100 1500 1500)
|
||||
Process: 3 registered... (2000 0 17 17)
|
||||
Process: 3 I/O blocked... (2000 0 18 18)
|
||||
Process: 4 registered... (2000 100 1500 1500)
|
||||
Process: 4 I/O blocked... (2000 100 1600 1600)
|
||||
Process: 3 registered... (2000 0 18 18)
|
||||
Process: 3 I/O blocked... (2000 0 19 19)
|
||||
Process: 4 registered... (2000 100 1600 1600)
|
||||
Process: 4 I/O blocked... (2000 100 1700 1700)
|
||||
Process: 3 registered... (2000 0 19 19)
|
||||
Process: 3 I/O blocked... (2000 0 20 20)
|
||||
Process: 4 registered... (2000 100 1700 1700)
|
||||
Process: 4 I/O blocked... (2000 100 1800 1800)
|
||||
Process: 3 registered... (2000 0 20 20)
|
||||
Process: 3 I/O blocked... (2000 0 21 21)
|
||||
Process: 4 registered... (2000 100 1800 1800)
|
||||
Process: 4 I/O blocked... (2000 100 1900 1900)
|
||||
Process: 3 registered... (2000 0 21 21)
|
||||
Process: 3 I/O blocked... (2000 0 22 22)
|
||||
Process: 4 registered... (2000 100 1900 1900)
|
||||
Process: 4 completed... (2000 100 2000 2000)
|
||||
Process: 3 registered... (2000 0 22 22)
|
||||
Process: 3 I/O blocked... (2000 0 22 22)
|
||||
Process: 5 registered... (2000 200 0 0)
|
||||
Process: 5 I/O blocked... (2000 200 200 200)
|
||||
Process: 3 registered... (2000 0 22 22)
|
||||
Process: 3 I/O blocked... (2000 0 23 23)
|
||||
Process: 5 registered... (2000 200 200 200)
|
||||
Process: 5 I/O blocked... (2000 200 400 400)
|
||||
Process: 3 registered... (2000 0 23 23)
|
||||
Process: 3 I/O blocked... (2000 0 24 24)
|
||||
Process: 5 registered... (2000 200 400 400)
|
||||
Process: 5 I/O blocked... (2000 200 600 600)
|
||||
Process: 3 registered... (2000 0 24 24)
|
||||
Process: 3 I/O blocked... (2000 0 25 25)
|
||||
Process: 5 registered... (2000 200 600 600)
|
||||
Process: 5 I/O blocked... (2000 200 800 800)
|
||||
Process: 3 registered... (2000 0 25 25)
|
||||
Process: 3 I/O blocked... (2000 0 26 26)
|
||||
Process: 5 registered... (2000 200 800 800)
|
||||
Process: 5 I/O blocked... (2000 200 1000 1000)
|
||||
Process: 3 registered... (2000 0 26 26)
|
||||
Process: 3 I/O blocked... (2000 0 27 27)
|
||||
Process: 5 registered... (2000 200 1000 1000)
|
||||
Process: 5 I/O blocked... (2000 200 1200 1200)
|
||||
Process: 3 registered... (2000 0 27 27)
|
||||
Process: 3 I/O blocked... (2000 0 28 28)
|
||||
Process: 5 registered... (2000 200 1200 1200)
|
||||
Process: 5 I/O blocked... (2000 200 1400 1400)
|
||||
Process: 3 registered... (2000 0 28 28)
|
||||
Process: 3 I/O blocked... (2000 0 29 29)
|
||||
Process: 5 registered... (2000 200 1400 1400)
|
||||
Process: 5 I/O blocked... (2000 200 1600 1600)
|
||||
Process: 3 registered... (2000 0 29 29)
|
||||
Process: 3 I/O blocked... (2000 0 30 30)
|
||||
Process: 5 registered... (2000 200 1600 1600)
|
||||
Process: 5 I/O blocked... (2000 200 1800 1800)
|
||||
Process: 3 registered... (2000 0 30 30)
|
||||
Process: 3 I/O blocked... (2000 0 31 31)
|
||||
Process: 5 registered... (2000 200 1800 1800)
|
||||
16
EOPSY/lab3/task3/processestwo
Normal file
16
EOPSY/lab3/task3/processestwo
Normal file
@ -0,0 +1,16 @@
|
||||
Process: 0 registered... (2000 500 0 0)
|
||||
Process: 0 I/O blocked... (2000 500 500 500)
|
||||
Process: 1 registered... (2000 500 0 0)
|
||||
Process: 1 I/O blocked... (2000 500 500 500)
|
||||
Process: 0 registered... (2000 500 500 500)
|
||||
Process: 0 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 1 registered... (2000 500 500 500)
|
||||
Process: 1 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 0 registered... (2000 500 1000 1000)
|
||||
Process: 0 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 1 registered... (2000 500 1000 1000)
|
||||
Process: 1 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 0 registered... (2000 500 1500 1500)
|
||||
Process: 0 completed... (2000 500 2000 2000)
|
||||
Process: 1 registered... (2000 500 1500 1500)
|
||||
Process: 1 completed... (2000 500 2000 2000)
|
||||
11
EOPSY/lab3/task3/resultsfive
Normal file
11
EOPSY/lab3/task3/resultsfive
Normal file
@ -0,0 +1,11 @@
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 10000
|
||||
Mean: 2000
|
||||
Standard Deviation: 0
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
1 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
2 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
3 2000 (ms) 0 (ms) 2000 (ms) 2001 times
|
||||
4 2000 (ms) 100 (ms) 2000 (ms) 19 times
|
||||
16
EOPSY/lab3/task3/resultsten
Normal file
16
EOPSY/lab3/task3/resultsten
Normal file
@ -0,0 +1,16 @@
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 10000
|
||||
Mean: 2000
|
||||
Standard Deviation: 0
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
1 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
2 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
3 2000 (ms) 0 (ms) 31 (ms) 33 times
|
||||
4 2000 (ms) 100 (ms) 2000 (ms) 19 times
|
||||
5 2000 (ms) 200 (ms) 1969 (ms) 9 times
|
||||
6 2000 (ms) 300 (ms) 0 (ms) 0 times
|
||||
7 2000 (ms) 400 (ms) 0 (ms) 0 times
|
||||
8 2000 (ms) 500 (ms) 0 (ms) 0 times
|
||||
9 2000 (ms) 600 (ms) 0 (ms) 0 times
|
||||
8
EOPSY/lab3/task3/resultstwo
Normal file
8
EOPSY/lab3/task3/resultstwo
Normal file
@ -0,0 +1,8 @@
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 4000
|
||||
Mean: 2000
|
||||
Standard Deviation: 0
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
1 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
340
EOPSY/lab3/task3/work/COPYING.TXT
Normal file
340
EOPSY/lab3/task3/work/COPYING.TXT
Normal file
@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
BIN
EOPSY/lab3/task3/work/Common.class
Normal file
BIN
EOPSY/lab3/task3/work/Common.class
Normal file
Binary file not shown.
56
EOPSY/lab3/task3/work/Common.java
Normal file
56
EOPSY/lab3/task3/work/Common.java
Normal file
@ -0,0 +1,56 @@
|
||||
public class Common {
|
||||
|
||||
static public int s2i (String s) {
|
||||
int i = 0;
|
||||
|
||||
try {
|
||||
i = Integer.parseInt(s.trim());
|
||||
} catch (NumberFormatException nfe) {
|
||||
System.out.println("NumberFormatException: " + nfe.getMessage());
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
static public double R1 () {
|
||||
java.util.Random generator = new java.util.Random(System.currentTimeMillis());
|
||||
double U = generator.nextDouble();
|
||||
while (U < 0 || U >= 1) {
|
||||
U = generator.nextDouble();
|
||||
}
|
||||
double V = generator.nextDouble();
|
||||
while (V < 0 || V >= 1) {
|
||||
V = generator.nextDouble();
|
||||
}
|
||||
double X = Math.sqrt((8/Math.E)) * (V - 0.5)/U;
|
||||
if (!(R2(X,U))) { return -1; }
|
||||
if (!(R3(X,U))) { return -1; }
|
||||
if (!(R4(X,U))) { return -1; }
|
||||
return X;
|
||||
}
|
||||
|
||||
static public boolean R2 (double X, double U) {
|
||||
if ((X * X) <= (5 - 4 * Math.exp(.25) * U)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static public boolean R3 (double X, double U) {
|
||||
if ((X * X) >= (4 * Math.exp(-1.35) / U + 1.4)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static public boolean R4 (double X, double U) {
|
||||
if ((X * X) < (-4 * Math.log(U))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
24
EOPSY/lab3/task3/work/Makefile
Normal file
24
EOPSY/lab3/task3/work/Makefile
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
default: info
|
||||
|
||||
|
||||
help:
|
||||
less README.tjk
|
||||
|
||||
compile:
|
||||
javac -nowarn *.java
|
||||
|
||||
run:
|
||||
java Scheduling scheduling.conf
|
||||
|
||||
setup:
|
||||
./setUp
|
||||
|
||||
info:
|
||||
@echo ""
|
||||
@echo "Use 'make' with one argument:"
|
||||
@echo ""
|
||||
@echo " make help"
|
||||
@echo " make compile"
|
||||
@echo " make run"
|
||||
@echo ""
|
||||
BIN
EOPSY/lab3/task3/work/Process.class
Normal file
BIN
EOPSY/lab3/task3/work/Process.class
Normal file
Binary file not shown.
15
EOPSY/lab3/task3/work/Process.java
Normal file
15
EOPSY/lab3/task3/work/Process.java
Normal file
@ -0,0 +1,15 @@
|
||||
public class Process {
|
||||
public int cputime;
|
||||
public int ioblocking;
|
||||
public int cpudone;
|
||||
public int ionext;
|
||||
public int numblocked;
|
||||
|
||||
public Process(int cputime, int ioblocking, int cpudone, int ionext, int numblocked) {
|
||||
this.cputime = cputime;
|
||||
this.ioblocking = ioblocking;
|
||||
this.cpudone = cpudone;
|
||||
this.ionext = ionext;
|
||||
this.numblocked = numblocked;
|
||||
}
|
||||
}
|
||||
199
EOPSY/lab3/task3/work/README.tjk
Normal file
199
EOPSY/lab3/task3/work/README.tjk
Normal file
@ -0,0 +1,199 @@
|
||||
|
||||
|
||||
WORKPLACE ORGANIZATION:
|
||||
mkdir ../work
|
||||
cd ../work
|
||||
cp ../ftp/* .
|
||||
gzip -d sched.tgz
|
||||
tar -xvf sched.tar
|
||||
rm sched.tar
|
||||
|
||||
|
||||
READING:
|
||||
less/vi README.tjk
|
||||
netscape/lynx install_unix.html
|
||||
netscape/lynx user_guide.html
|
||||
|
||||
|
||||
COMPILE:
|
||||
javac -nowarn *.java
|
||||
|
||||
|
||||
RUN:
|
||||
java Scheduling scheduling.conf
|
||||
|
||||
|
||||
FILES:
|
||||
input file name: scheduling.conf
|
||||
output file name: Summary-Processes
|
||||
log file name: Summary-Processes
|
||||
|
||||
|
||||
--[ YOUR TASK ]-------------------------------------------------------
|
||||
|
||||
Create a configuration file in which all processes run an average
|
||||
of 2000 milliseconds with a standard deviation of zero, and which
|
||||
are blocked for input or output every 500 milliseconds. Run the
|
||||
simulation for 10000 milliseconds with 2 processes. Examine the
|
||||
two output files. Try again for 5 processes. Try again for 10
|
||||
processes. Explain what's happening.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
The Configuration File
|
||||
|
||||
The configuration file (scheduling.conf) is used to specify various
|
||||
parameters for the simulation, including:
|
||||
* the number of processes,
|
||||
* the mean runtime for a process,
|
||||
* the standard deviation in runtime for a process,
|
||||
* for each process, how long the process runs before it blocks for
|
||||
input or output, and
|
||||
* how long the simulation should run.
|
||||
|
||||
Configuration File Options
|
||||
|
||||
There are a number of options which can be specified in the
|
||||
configuration file. These are summarized in the table below.
|
||||
|
||||
Keyword Values Description
|
||||
numprocess n The number of processes to create for the simulation.
|
||||
meandev n The average length of time in milliseconds that a process
|
||||
should execute before terminating.
|
||||
standdev n The number of standard deviations from the average length
|
||||
of time a process should execute before terminating.
|
||||
process n The amount of time in milliseconds that the process should
|
||||
execute before blocking for input or output. There should be a
|
||||
separate process directive for each process specified by the
|
||||
numprocess directive.
|
||||
runtime n The maximum amount of time the simulation should run in
|
||||
milliseconds.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Sample Configuration File
|
||||
|
||||
The "scheduling.conf" configuration file looks like this:
|
||||
|
||||
// # of Process
|
||||
numprocess 3
|
||||
|
||||
// mean deivation
|
||||
meandev 1100
|
||||
|
||||
// standard deviation
|
||||
standdev 510
|
||||
|
||||
// process # I/O blocking
|
||||
process 100
|
||||
process 500
|
||||
process 30
|
||||
|
||||
// duration of the simulation in milliseconds
|
||||
runtime 5000
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
The Summary-Results File
|
||||
|
||||
The Summary-Results file contains a summary report describing the
|
||||
simulation and includes one line of summary information for each
|
||||
process. The fields and columns in the report are described in the
|
||||
following table.
|
||||
|
||||
Field Description
|
||||
Scheduling Type: The type of the scheduling algorithm used. The value
|
||||
displayed is "hard coded" in the SchedulingAlgorithm.java file.
|
||||
Scheduling Name: The name of the scheduling algorithm used. The value
|
||||
displayed is "hard coded" in the SchedulingAlgorithm.java file.
|
||||
Simulation Run Time: The number of milliseconds that the simulation
|
||||
ran. This may be less than or equal to the total amount of time
|
||||
specified by the "runtime" configuration parameter.
|
||||
Mean: The average amount of runtime for the processes as specified by
|
||||
the "meandev" configuration parameter.
|
||||
Standard Deviation: The standard deviation from the average amount of
|
||||
runtime for the processes as specified by the "standdev" configuration
|
||||
parameter.
|
||||
Process # The process number assigned to the process by the simulator.
|
||||
The process number is between 0 and n-1, where n is the number
|
||||
specified by the "numprocess" configuration parameter.
|
||||
CPU Time The randomly generated total runtime for the process in
|
||||
milliseconds. This is determined by the "meandev" and "standdev"
|
||||
parameters in the configuration file.
|
||||
IO Blocking The amount of time the process runs before it blocks for
|
||||
input or output. This is specified for each process by a "process"
|
||||
directive in the configuration file.
|
||||
CPU Completed The amount of runtime in milliseconds completed for the
|
||||
process. Note that this may be less than the CPU Time for the process
|
||||
if the simulator runs out of time as specified by the "runtime"
|
||||
configuration parameter.
|
||||
CPU Blocked The number of times the process blocked for input or
|
||||
output during the simulation.
|
||||
|
||||
Sample Summary-Results File
|
||||
|
||||
The output "Summary-Results" file looks something like this:
|
||||
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 2750
|
||||
Mean: 1100
|
||||
Standard Deviation: 510
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 1372 (ms) 100 (ms) 1372 (ms) 13 times
|
||||
1 689 (ms) 500 (ms) 689 (ms) 1 times
|
||||
2 689 (ms) 30 (ms) 689 (ms) 22 times
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
The Summary-Processes File
|
||||
|
||||
The Summary-Processes file contains a log of the actions taken by the
|
||||
scheduling algorithm as it considers each process in the scheduling
|
||||
queue.
|
||||
|
||||
Each line in the log file is of the following form:
|
||||
|
||||
Process: process-number process-status... (cpu-time block-time accumulated-time
|
||||
accumulated-time)
|
||||
|
||||
The fields in the line are described in the table below.
|
||||
|
||||
Field Description
|
||||
process-number The process number assigned to the process by the
|
||||
simulator. This is a number between 0 and n-1, where n is the value
|
||||
specified for the "numprocess" configuration parameter.
|
||||
process-status The status of the process at this point in time. If
|
||||
"registered" then the process is under consideration by the scheduling
|
||||
algorithm. If "I/O blocked", then the scheduling algorithm has noticed
|
||||
that the process is blocked for input or output. If "completed", then
|
||||
the scheduling algorithm has noticed that the process has met or
|
||||
exceeded its allocated execution time.
|
||||
cpu-time The total amount of run time allowed for this process. This
|
||||
number is randomly generated for the process based on the "meandev"
|
||||
and "standdev" values specified in the configuration file.
|
||||
block-time The amount of time in milliseconds to execute before
|
||||
blocking process. This number is specified for the process by the
|
||||
"process" directive in the configuration file.
|
||||
accumulated-time The total amount of time process has executed in
|
||||
milliseconds. (This number appears twice in the log file; one should
|
||||
be removed).
|
||||
|
||||
Sample Summary-Processes File
|
||||
|
||||
The output "Summary-Processes" file looks something like this:
|
||||
|
||||
Process: 0 registered... (1372 100 0 0)
|
||||
Process: 0 I/O blocked... (1372 100 100 100)
|
||||
Process: 1 registered... (689 500 0 0)
|
||||
Process: 1 I/O blocked... (689 500 500 500)
|
||||
Process: 0 registered... (1372 100 100 100)
|
||||
Process: 0 I/O blocked... (1372 100 200 200)
|
||||
Process: 1 registered... (689 500 500 500)
|
||||
Process: 1 completed... (689 500 689 689)
|
||||
Process: 0 registered... (1372 100 200 200)
|
||||
Process: 0 I/O blocked... (1372 100 300 300)
|
||||
Process: 2 registered... (689 30 0 0)
|
||||
Process: 2 I/O blocked... (689 30 30 30)
|
||||
|
||||
BIN
EOPSY/lab3/task3/work/Results.class
Normal file
BIN
EOPSY/lab3/task3/work/Results.class
Normal file
Binary file not shown.
11
EOPSY/lab3/task3/work/Results.java
Normal file
11
EOPSY/lab3/task3/work/Results.java
Normal file
@ -0,0 +1,11 @@
|
||||
public class Results {
|
||||
public String schedulingType;
|
||||
public String schedulingName;
|
||||
public int compuTime;
|
||||
|
||||
public Results (String schedulingType, String schedulingName, int compuTime) {
|
||||
this.schedulingType = schedulingType;
|
||||
this.schedulingName = schedulingName;
|
||||
this.compuTime = compuTime;
|
||||
}
|
||||
}
|
||||
BIN
EOPSY/lab3/task3/work/Scheduling.class
Normal file
BIN
EOPSY/lab3/task3/work/Scheduling.class
Normal file
Binary file not shown.
144
EOPSY/lab3/task3/work/Scheduling.java
Normal file
144
EOPSY/lab3/task3/work/Scheduling.java
Normal file
@ -0,0 +1,144 @@
|
||||
// This file contains the main() function for the Scheduling
|
||||
// simulation. Init() initializes most of the variables by
|
||||
// reading from a provided file. SchedulingAlgorithm.Run() is
|
||||
// called from main() to run the simulation. Summary-Results
|
||||
// is where the summary results are written, and Summary-Processes
|
||||
// is where the process scheduling summary is written.
|
||||
|
||||
// Created by Alexander Reeder, 2001 January 06
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
public class Scheduling {
|
||||
|
||||
private static int processnum = 5;
|
||||
private static int meanDev = 1000;
|
||||
private static int standardDev = 100;
|
||||
private static int runtime = 1000;
|
||||
private static Vector processVector = new Vector();
|
||||
private static Results result = new Results("null","null",0);
|
||||
private static String resultsFile = "Summary-Results";
|
||||
|
||||
private static void Init(String file) {
|
||||
File f = new File(file);
|
||||
String line;
|
||||
String tmp;
|
||||
int cputime = 0;
|
||||
int ioblocking = 0;
|
||||
double X = 0.0;
|
||||
|
||||
try {
|
||||
//BufferedReader in = new BufferedReader(new FileReader(f));
|
||||
DataInputStream in = new DataInputStream(new FileInputStream(f));
|
||||
while ((line = in.readLine()) != null) {
|
||||
if (line.startsWith("numprocess")) {
|
||||
StringTokenizer st = new StringTokenizer(line);
|
||||
st.nextToken();
|
||||
processnum = Common.s2i(st.nextToken());
|
||||
}
|
||||
if (line.startsWith("meandev")) {
|
||||
StringTokenizer st = new StringTokenizer(line);
|
||||
st.nextToken();
|
||||
meanDev = Common.s2i(st.nextToken());
|
||||
}
|
||||
if (line.startsWith("standdev")) {
|
||||
StringTokenizer st = new StringTokenizer(line);
|
||||
st.nextToken();
|
||||
standardDev = Common.s2i(st.nextToken());
|
||||
}
|
||||
if (line.startsWith("process")) {
|
||||
StringTokenizer st = new StringTokenizer(line);
|
||||
st.nextToken();
|
||||
ioblocking = Common.s2i(st.nextToken());
|
||||
X = Common.R1();
|
||||
while (X == -1.0) {
|
||||
X = Common.R1();
|
||||
}
|
||||
X = X * standardDev;
|
||||
cputime = (int) X + meanDev;
|
||||
processVector.addElement(new sProcess(cputime, ioblocking, 0, 0, 0));
|
||||
}
|
||||
if (line.startsWith("runtime")) {
|
||||
StringTokenizer st = new StringTokenizer(line);
|
||||
st.nextToken();
|
||||
runtime = Common.s2i(st.nextToken());
|
||||
}
|
||||
}
|
||||
in.close();
|
||||
} catch (IOException e) { /* Handle exceptions */ }
|
||||
}
|
||||
|
||||
private static void debug() {
|
||||
int i = 0;
|
||||
|
||||
System.out.println("processnum " + processnum);
|
||||
System.out.println("meandevm " + meanDev);
|
||||
System.out.println("standdev " + standardDev);
|
||||
int size = processVector.size();
|
||||
for (i = 0; i < size; i++) {
|
||||
sProcess process = (sProcess) processVector.elementAt(i);
|
||||
System.out.println("process " + i + " " + process.cputime + " " + process.ioblocking + " " + process.cpudone + " " + process.numblocked);
|
||||
}
|
||||
System.out.println("runtime " + runtime);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
int i = 0;
|
||||
|
||||
if (args.length != 1) {
|
||||
System.out.println("Usage: 'java Scheduling <INIT FILE>'");
|
||||
System.exit(-1);
|
||||
}
|
||||
File f = new File(args[0]);
|
||||
if (!(f.exists())) {
|
||||
System.out.println("Scheduling: error, file '" + f.getName() + "' does not exist.");
|
||||
System.exit(-1);
|
||||
}
|
||||
if (!(f.canRead())) {
|
||||
System.out.println("Scheduling: error, read of " + f.getName() + " failed.");
|
||||
System.exit(-1);
|
||||
}
|
||||
System.out.println("Working...");
|
||||
Init(args[0]);
|
||||
if (processVector.size() < processnum) {
|
||||
i = 0;
|
||||
while (processVector.size() < processnum) {
|
||||
double X = Common.R1();
|
||||
while (X == -1.0) {
|
||||
X = Common.R1();
|
||||
}
|
||||
X = X * standardDev;
|
||||
int cputime = (int) X + meanDev;
|
||||
processVector.addElement(new sProcess(cputime,i*100,0,0,0));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
result = SchedulingAlgorithm.Run(runtime, processVector, result);
|
||||
try {
|
||||
//BufferedWriter out = new BufferedWriter(new FileWriter(resultsFile));
|
||||
PrintStream out = new PrintStream(new FileOutputStream(resultsFile));
|
||||
out.println("Scheduling Type: " + result.schedulingType);
|
||||
out.println("Scheduling Name: " + result.schedulingName);
|
||||
out.println("Simulation Run Time: " + result.compuTime);
|
||||
out.println("Mean: " + meanDev);
|
||||
out.println("Standard Deviation: " + standardDev);
|
||||
out.println("Process #\tCPU Time\tIO Blocking\tCPU Completed\tCPU Blocked");
|
||||
for (i = 0; i < processVector.size(); i++) {
|
||||
sProcess process = (sProcess) processVector.elementAt(i);
|
||||
out.print(Integer.toString(i));
|
||||
if (i < 100) { out.print("\t\t"); } else { out.print("\t"); }
|
||||
out.print(Integer.toString(process.cputime));
|
||||
if (process.cputime < 100) { out.print(" (ms)\t\t"); } else { out.print(" (ms)\t"); }
|
||||
out.print(Integer.toString(process.ioblocking));
|
||||
if (process.ioblocking < 100) { out.print(" (ms)\t\t"); } else { out.print(" (ms)\t"); }
|
||||
out.print(Integer.toString(process.cpudone));
|
||||
if (process.cpudone < 100) { out.print(" (ms)\t\t"); } else { out.print(" (ms)\t"); }
|
||||
out.println(process.numblocked + " times");
|
||||
}
|
||||
out.close();
|
||||
} catch (IOException e) { /* Handle exceptions */ }
|
||||
System.out.println("Completed.");
|
||||
}
|
||||
}
|
||||
|
||||
BIN
EOPSY/lab3/task3/work/SchedulingAlgorithm.class
Normal file
BIN
EOPSY/lab3/task3/work/SchedulingAlgorithm.class
Normal file
Binary file not shown.
70
EOPSY/lab3/task3/work/SchedulingAlgorithm.java
Normal file
70
EOPSY/lab3/task3/work/SchedulingAlgorithm.java
Normal file
@ -0,0 +1,70 @@
|
||||
// Run() is called from Scheduling.main() and is where
|
||||
// the scheduling algorithm written by the user resides.
|
||||
// User modification should occur within the Run() function.
|
||||
|
||||
import java.util.Vector;
|
||||
import java.io.*;
|
||||
|
||||
public class SchedulingAlgorithm {
|
||||
|
||||
public static Results Run(int runtime, Vector processVector, Results result) {
|
||||
int i = 0;
|
||||
int comptime = 0;
|
||||
int currentProcess = 0;
|
||||
int previousProcess = 0;
|
||||
int size = processVector.size();
|
||||
int completed = 0;
|
||||
String resultsFile = "Summary-Processes";
|
||||
|
||||
result.schedulingType = "Batch (Nonpreemptive)";
|
||||
result.schedulingName = "First-Come First-Served";
|
||||
try {
|
||||
//BufferedWriter out = new BufferedWriter(new FileWriter(resultsFile));
|
||||
//OutputStream out = new FileOutputStream(resultsFile);
|
||||
PrintStream out = new PrintStream(new FileOutputStream(resultsFile));
|
||||
sProcess process = (sProcess) processVector.elementAt(currentProcess);
|
||||
out.println("Process: " + currentProcess + " registered... (" + process.cputime + " " + process.ioblocking + " " + process.cpudone + " " + process.cpudone + ")");
|
||||
while (comptime < runtime) {
|
||||
if (process.cpudone == process.cputime) {
|
||||
completed++;
|
||||
out.println("Process: " + currentProcess + " completed... (" + process.cputime + " " + process.ioblocking + " " + process.cpudone + " " + process.cpudone + ")");
|
||||
if (completed == size) {
|
||||
result.compuTime = comptime;
|
||||
out.close();
|
||||
return result;
|
||||
}
|
||||
for (i = size - 1; i >= 0; i--) {
|
||||
process = (sProcess) processVector.elementAt(i);
|
||||
if (process.cpudone < process.cputime) {
|
||||
currentProcess = i;
|
||||
}
|
||||
}
|
||||
process = (sProcess) processVector.elementAt(currentProcess);
|
||||
out.println("Process: " + currentProcess + " registered... (" + process.cputime + " " + process.ioblocking + " " + process.cpudone + " " + process.cpudone + ")");
|
||||
}
|
||||
if (process.ioblocking == process.ionext) {
|
||||
out.println("Process: " + currentProcess + " I/O blocked... (" + process.cputime + " " + process.ioblocking + " " + process.cpudone + " " + process.cpudone + ")");
|
||||
process.numblocked++;
|
||||
process.ionext = 0;
|
||||
previousProcess = currentProcess;
|
||||
for (i = size - 1; i >= 0; i--) {
|
||||
process = (sProcess) processVector.elementAt(i);
|
||||
if (process.cpudone < process.cputime && previousProcess != i) {
|
||||
currentProcess = i;
|
||||
}
|
||||
}
|
||||
process = (sProcess) processVector.elementAt(currentProcess);
|
||||
out.println("Process: " + currentProcess + " registered... (" + process.cputime + " " + process.ioblocking + " " + process.cpudone + " " + process.cpudone + ")");
|
||||
}
|
||||
process.cpudone++;
|
||||
if (process.ioblocking > 0) {
|
||||
process.ionext++;
|
||||
}
|
||||
comptime++;
|
||||
}
|
||||
out.close();
|
||||
} catch (IOException e) { /* Handle exceptions */ }
|
||||
result.compuTime = comptime;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
39
EOPSY/lab3/task3/work/Summary-Processes
Normal file
39
EOPSY/lab3/task3/work/Summary-Processes
Normal file
@ -0,0 +1,39 @@
|
||||
Process: 0 registered... (2000 500 0 0)
|
||||
Process: 0 I/O blocked... (2000 500 500 500)
|
||||
Process: 1 registered... (2000 500 0 0)
|
||||
Process: 1 I/O blocked... (2000 500 500 500)
|
||||
Process: 0 registered... (2000 500 500 500)
|
||||
Process: 0 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 1 registered... (2000 500 500 500)
|
||||
Process: 1 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 0 registered... (2000 500 1000 1000)
|
||||
Process: 0 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 1 registered... (2000 500 1000 1000)
|
||||
Process: 1 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 0 registered... (2000 500 1500 1500)
|
||||
Process: 0 completed... (2000 500 2000 2000)
|
||||
Process: 1 registered... (2000 500 1500 1500)
|
||||
Process: 1 completed... (2000 500 2000 2000)
|
||||
Process: 2 registered... (2000 500 0 0)
|
||||
Process: 2 I/O blocked... (2000 500 500 500)
|
||||
Process: 3 registered... (2000 500 0 0)
|
||||
Process: 3 I/O blocked... (2000 500 500 500)
|
||||
Process: 2 registered... (2000 500 500 500)
|
||||
Process: 2 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 3 registered... (2000 500 500 500)
|
||||
Process: 3 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 2 registered... (2000 500 1000 1000)
|
||||
Process: 2 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 3 registered... (2000 500 1000 1000)
|
||||
Process: 3 I/O blocked... (2000 500 1500 1500)
|
||||
Process: 2 registered... (2000 500 1500 1500)
|
||||
Process: 2 completed... (2000 500 2000 2000)
|
||||
Process: 3 registered... (2000 500 1500 1500)
|
||||
Process: 3 completed... (2000 500 2000 2000)
|
||||
Process: 4 registered... (2000 500 0 0)
|
||||
Process: 4 I/O blocked... (2000 500 500 500)
|
||||
Process: 5 registered... (2000 500 0 0)
|
||||
Process: 5 I/O blocked... (2000 500 500 500)
|
||||
Process: 4 registered... (2000 500 500 500)
|
||||
Process: 4 I/O blocked... (2000 500 1000 1000)
|
||||
Process: 5 registered... (2000 500 500 500)
|
||||
16
EOPSY/lab3/task3/work/Summary-Results
Normal file
16
EOPSY/lab3/task3/work/Summary-Results
Normal file
@ -0,0 +1,16 @@
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 10000
|
||||
Mean: 2000
|
||||
Standard Deviation: 0
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
1 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
2 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
3 2000 (ms) 500 (ms) 2000 (ms) 3 times
|
||||
4 2000 (ms) 500 (ms) 1000 (ms) 2 times
|
||||
5 2000 (ms) 500 (ms) 1000 (ms) 1 times
|
||||
6 2000 (ms) 500 (ms) 0 (ms) 0 times
|
||||
7 2000 (ms) 500 (ms) 0 (ms) 0 times
|
||||
8 2000 (ms) 500 (ms) 0 (ms) 0 times
|
||||
9 2000 (ms) 500 (ms) 0 (ms) 0 times
|
||||
8
EOPSY/lab3/task3/work/description.txt
Normal file
8
EOPSY/lab3/task3/work/description.txt
Normal file
@ -0,0 +1,8 @@
|
||||
The scheduling simulator illustrates the behavior of scheduling
|
||||
algorithms against a simulated mix of process loads. The user can
|
||||
specify the number of processes, the mean and standard deviation
|
||||
for compute time and I/O blocking time for each process, and the
|
||||
duration of the simulation. At the end of the simulation a
|
||||
statistical summary is presented. Students may also be asked to
|
||||
write their own scheduling algorithms to be used with process
|
||||
loads defined by the instructor.
|
||||
512
EOPSY/lab3/task3/work/install_unix.html
Normal file
512
EOPSY/lab3/task3/work/install_unix.html
Normal file
@ -0,0 +1,512 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>MOSS | Scheduling Simlulator | Installation |
|
||||
|
||||
|
||||
Unix
|
||||
|
||||
</title>
|
||||
</head>
|
||||
<body bgcolor="#ffffff">
|
||||
|
||||
<h1>MOSS Scheduling Simulator
|
||||
|
||||
|
||||
<br>Installation on Unix/Linux/Solaris/HP-UX Systems</h1>
|
||||
|
||||
|
||||
<h2>Purpose</h2>
|
||||
|
||||
<p>
|
||||
This document provides instructions for the installation
|
||||
of the MOSS Scheduling Simulator on
|
||||
|
||||
|
||||
Unix
|
||||
|
||||
operating systems. This procedure should be the same or similar on
|
||||
|
||||
|
||||
Unix, Linux, Solaris, HP-UX and other Unix-compatible
|
||||
|
||||
systems.
|
||||
The MOSS software
|
||||
is designed for use with
|
||||
<a href="http://www.cs.vu.nl/~ast/">Andrew S. Tanenbaum</a>,
|
||||
<a href="http://vig.prenhall.com/catalog/academic/product/1,4096,0130313580,00.html">Modern Operating Systems, 2nd Edition</a>
|
||||
(<a href="http://www.prenhall.com/">Prentice Hall</a>, 2001).
|
||||
The Scheduling Simulator was written by
|
||||
<a href="http://www.cs.earlham.edu/~odo/">Alex Reeder</a>
|
||||
(<a href="mailto:alexr@e-sa.org"><i>alexr@e-sa.org</i></a>).
|
||||
This installation guide was written by
|
||||
<a href="http://www.ontko.com/~rayo/">Ray Ontko</a>
|
||||
(<a href="mailto:rayo@ontko.com"><i>rayo@ontko.com</i></a>).
|
||||
<p>
|
||||
This installation guide only provides information about installing
|
||||
the software and testing the configuration for
|
||||
|
||||
Unix-like operating systems. To install on Windows
|
||||
operating systems, please read the
|
||||
<a href="install_windows.html">Installation Guide for
|
||||
Win95/98/Me/NT/2000 Systems</a>.
|
||||
|
||||
|
||||
For more detailed information about the simulator, please read the
|
||||
<a href="user_guide.html">User Guide</a>.
|
||||
</p>
|
||||
<h2>Requirements</h2>
|
||||
|
||||
The following software components are required
|
||||
to install and use the MOSS Scheduling
|
||||
Simulator.
|
||||
<ul>
|
||||
|
||||
|
||||
<li>X-windows environment for running Java Application Window Toolkit (AWT) programs
|
||||
|
||||
<li>Java Development Kit (JDK) 1.0 or greater
|
||||
<li>Text program editor (e.g., notepad)
|
||||
</ul>
|
||||
|
||||
<h2>Pre-Installation</h2>
|
||||
<p>
|
||||
Before installation, you should verify:
|
||||
</p>
|
||||
<ul>
|
||||
<li>that you have a working java runtime environment,
|
||||
<li>that you have a working java development environment, and
|
||||
<li>that the working directory is in the classpath for the runtime environment.
|
||||
</ul>
|
||||
<p>
|
||||
If you're using a standard command-line java compiler, the following
|
||||
instructions will help determine if your environment is configured
|
||||
correctly.
|
||||
</p>
|
||||
<ol>
|
||||
<li>Verify that you have java installed and configured in your environment.
|
||||
|
||||
|
||||
<blockquote><pre>
|
||||
$ java -version
|
||||
</pre></blockquote>
|
||||
|
||||
You should see a message like this with possibly a different version number.
|
||||
<blockquote><pre>
|
||||
java version "1.1.8"
|
||||
</pre></blockquote>
|
||||
If you get a message like:
|
||||
|
||||
|
||||
<blockquote><pre>
|
||||
java: Command not found.
|
||||
</pre></blockquote>
|
||||
|
||||
Then java may not be installed on your system, or may not be configured
|
||||
for your use.
|
||||
<p>
|
||||
If you think that Java may already be installed on your system
|
||||
but may not be in your "path", you can find it by
|
||||
|
||||
|
||||
<blockquote><pre>
|
||||
$ find /usr -name java -print
|
||||
</pre></blockquote>
|
||||
On my system, for example, the following is returned.
|
||||
<blockquote><pre>
|
||||
/usr/lib/netscape/477/communicator/java
|
||||
/usr/lib/netscape/477/netscape/java
|
||||
/usr/lib/jdk1.1/bin/java
|
||||
/usr/lib/jdk1.1/bin/ia32/green_threads/java
|
||||
/usr/share/java
|
||||
/usr/bin/java
|
||||
/usr/src/kernel-source-2.2.17/include/config/binfmt/java
|
||||
</pre></blockquote>
|
||||
On my system, I also searched for "javac" and found
|
||||
that it exists in /usr/bin/java. I'll use this jdk for my
|
||||
installation.
|
||||
|
||||
<p>
|
||||
If Java isn't available on your system, you should check with
|
||||
your instructor or system administrator. If you administer your
|
||||
own system, then you should be able to find a copy of Java
|
||||
for your operating system.
|
||||
<p>
|
||||
If you find that java is installed but not configured for
|
||||
your use, then perhaps you need to add it to your path. Consult
|
||||
your instructor or system administrator if you need help adding this
|
||||
to your path.
|
||||
</p>
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Verify that the java compiler is installed and configured in
|
||||
your environment.
|
||||
|
||||
|
||||
<blockquote><pre>
|
||||
$ javac
|
||||
</pre></blockquote>
|
||||
|
||||
If you're using a standard java command-line compiler, you should
|
||||
see a message similar to this.
|
||||
<blockquote><pre>
|
||||
use: javac [-g][-O][-debug][-depend][-nowarn][-verbose][-classpath path][-nowrite][-deprecation][-d dir][-J<runtime flag>] file.java...
|
||||
</pre></blockquote>
|
||||
If you get a message like:
|
||||
|
||||
|
||||
<blockquote><pre>
|
||||
javac: Command not found.
|
||||
</pre></blockquote>
|
||||
|
||||
then the java compiler may not be installed on your system, or
|
||||
may not be configured for your use. Consult your instructor
|
||||
or system administrator.
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Verify that that the current directory is in your classpath.
|
||||
|
||||
|
||||
<blockquote><pre>
|
||||
$ echo $CLASSPATH
|
||||
</pre></blockquote>
|
||||
You should see a list of directories separated by colons (":")
|
||||
or possibly just a blank line. If you don't see the directory
|
||||
"." (a single period, which stands for the current directory), then
|
||||
you should add it to the claspath.
|
||||
<p>
|
||||
Determine which shell you're using:
|
||||
</p>
|
||||
<blockquote><pre>
|
||||
$ echo $SHELL
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
If you're using sh, ksh, or bash:
|
||||
</p>
|
||||
<blockquote><pre>
|
||||
$ CLASSPATH=.:$CLASSPATH
|
||||
$ export CLASSPATH
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
If you're using csh, or tcsh:
|
||||
</p>
|
||||
<blockquote><pre>
|
||||
% set CLASSPATH=.:$CLASSPATH
|
||||
</pre></blockquote>
|
||||
|
||||
<p><!-- --></p>
|
||||
|
||||
</ol>
|
||||
<p>
|
||||
If you have a working java runtime environment, a working java
|
||||
compiler, and the current directory is in your path, then you're
|
||||
ready to proceed with the installation.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>Installation</h2>
|
||||
|
||||
Installation of the software can be accomplished with
|
||||
these simple steps:
|
||||
<ol>
|
||||
<li>
|
||||
|
||||
|
||||
Create a directory in which you wish to install the
|
||||
simulator (e.g., "moss/sched").
|
||||
<blockquote><pre>
|
||||
$ cd
|
||||
$ mkdir moss
|
||||
$ cd moss
|
||||
$ mkdir sched
|
||||
$ cd sched
|
||||
</pre></blockquote>
|
||||
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
Download the compressed tar archive (sched.tgz) into
|
||||
the directory.
|
||||
The latest release for this file can always be found at
|
||||
<a href="http://www.ontko.com/moss/sched/sched.tgz">http://www.ontko.com/moss/sched/sched.tgz</a>.
|
||||
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
Expand the compressed tar archive.
|
||||
<blockquote><pre>
|
||||
$ tar -xzf sched.tgz
|
||||
</pre></blockquote>
|
||||
or
|
||||
<blockquote><pre>
|
||||
$ gunzip sched.tgz
|
||||
$ tar xf sched.tar
|
||||
</pre></blockquote>
|
||||
|
||||
<p><!-- --></p>
|
||||
|
||||
</ol>
|
||||
<h2>Files</h2>
|
||||
<p>
|
||||
The directory should now contain the following files:
|
||||
</p>
|
||||
<table border="1" cellspacing="0">
|
||||
<tr>
|
||||
<th>Files
|
||||
<th>Description
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
|
||||
sched.tgz
|
||||
<td>Compressed tar
|
||||
|
||||
archive which contains all the other files.
|
||||
<tr>
|
||||
<td>Common.java
|
||||
<br>Process.java
|
||||
<br>Results.java
|
||||
<br>Scheduling.java
|
||||
<br>SchedulingAlgorithm.java
|
||||
<br>sProcess.java
|
||||
<td valign="top">
|
||||
Java source files (*.java)
|
||||
<tr>
|
||||
<td>Common.class
|
||||
<br>Process.class
|
||||
<br>Results.class
|
||||
<br>Scheduling.class
|
||||
<br>SchedulingAlgorithm.class
|
||||
<br>sProcess.class
|
||||
<td valign="top">
|
||||
Compiled Java class files (*.class)
|
||||
<tr>
|
||||
<td>scheduling.conf
|
||||
<td>Sample configuration file
|
||||
<tr>
|
||||
<td>install_unix.html
|
||||
<br>install_windows.html
|
||||
<br>user_guide.html
|
||||
<td valign="top">
|
||||
Documentation
|
||||
<tr>
|
||||
<td>COPYING.TXT</td>
|
||||
<td>Gnu General Public License: Terms and Conditions
|
||||
for Copying, Distribution, and Modification
|
||||
</table>
|
||||
|
||||
<h2>Compilation</h2>
|
||||
|
||||
<p>
|
||||
The distribution includes compiled class files as
|
||||
well as the source java files. You should not need
|
||||
to recompile unless you decide to change the code.
|
||||
If you wish to compile the code,
|
||||
the following commands should work if you're using
|
||||
a Java compiler that accepts the normal "javac" command
|
||||
line.
|
||||
|
||||
|
||||
<p>
|
||||
To determine which shell you're using:
|
||||
</p>
|
||||
<blockquote><pre>
|
||||
$ echo $SHELL
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
If you're using sh, ksh, bash:
|
||||
</p>
|
||||
<blockquote><pre>
|
||||
$ CLASSPATH=.
|
||||
$ export CLASSPATH
|
||||
$ javac -nowarn *.java
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
If you're using csh, tcsh:
|
||||
</p>
|
||||
<blockquote><pre>
|
||||
% set CLASSPATH=.
|
||||
% javac -nowarn *.java
|
||||
</pre></blockquote>
|
||||
|
||||
|
||||
The <tt>-nowarn</tt> flag supresses warning messges, of which
|
||||
there may be several. For backward compatability we use only
|
||||
those features of Java which have been present from the beginning,
|
||||
some of which are deprecated and are usually reported by the
|
||||
compiler with warning messages.
|
||||
|
||||
<h2>Test</h2>
|
||||
|
||||
<p>
|
||||
To test the program, enter the following commands.
|
||||
|
||||
|
||||
|
||||
<blockquote><pre>
|
||||
$ java Scheduling scheduling.conf
|
||||
</pre></blockquote>
|
||||
|
||||
|
||||
<p>
|
||||
The program will simply run the simulation based on the
|
||||
information provided in <tt>scheduling.conf</tt> and write its
|
||||
output to the <tt>Summary-Results</tt> and
|
||||
<tt>Summary-Processes</tt> files. You should see the following
|
||||
output.
|
||||
<blockquote><pre>
|
||||
Working...
|
||||
Completed.
|
||||
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
The simulation configuration information is read from a file called
|
||||
"scheduling.conf".
|
||||
The "scheduling.conf" file looks something like this:
|
||||
<blockquote><pre>
|
||||
// # of Process
|
||||
numprocess 3
|
||||
|
||||
// mean deivation
|
||||
meandev 1100
|
||||
|
||||
// standard deviation
|
||||
standdev 510
|
||||
|
||||
// process # I/O blocking
|
||||
process 100
|
||||
process 500
|
||||
process 30
|
||||
|
||||
// duration of the simulation in milliseconds
|
||||
runtime 5000
|
||||
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
If things are working correctly, the "Summary-Results" file should look
|
||||
something like this:
|
||||
|
||||
<blockquote><pre>
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 2750
|
||||
Mean: 1100
|
||||
Standard Deviation: 510
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 1372 (ms) 100 (ms) 1372 (ms) 13 times
|
||||
1 689 (ms) 500 (ms) 689 (ms) 1 times
|
||||
2 689 (ms) 30 (ms) 689 (ms) 22 times
|
||||
|
||||
</pre></blockquote>
|
||||
|
||||
and the "Summary-Processes" file should look something like
|
||||
this:
|
||||
|
||||
<blockquote><pre>
|
||||
Process: 0 registered... (1372 100 0 0)
|
||||
Process: 0 I/O blocked... (1372 100 100 100)
|
||||
Process: 1 registered... (689 500 0 0)
|
||||
Process: 1 I/O blocked... (689 500 500 500)
|
||||
Process: 0 registered... (1372 100 100 100)
|
||||
Process: 0 I/O blocked... (1372 100 200 200)
|
||||
Process: 1 registered... (689 500 500 500)
|
||||
Process: 1 completed... (689 500 689 689)
|
||||
Process: 0 registered... (1372 100 200 200)
|
||||
Process: 0 I/O blocked... (1372 100 300 300)
|
||||
Process: 2 registered... (689 30 0 0)
|
||||
Process: 2 I/O blocked... (689 30 30 30)
|
||||
Process: 0 registered... (1372 100 300 300)
|
||||
Process: 0 I/O blocked... (1372 100 400 400)
|
||||
Process: 2 registered... (689 30 30 30)
|
||||
Process: 2 I/O blocked... (689 30 60 60)
|
||||
Process: 0 registered... (1372 100 400 400)
|
||||
Process: 0 I/O blocked... (1372 100 500 500)
|
||||
Process: 2 registered... (689 30 60 60)
|
||||
Process: 2 I/O blocked... (689 30 90 90)
|
||||
Process: 0 registered... (1372 100 500 500)
|
||||
Process: 0 I/O blocked... (1372 100 600 600)
|
||||
Process: 2 registered... (689 30 90 90)
|
||||
Process: 2 I/O blocked... (689 30 120 120)
|
||||
Process: 0 registered... (1372 100 600 600)
|
||||
Process: 0 I/O blocked... (1372 100 700 700)
|
||||
Process: 2 registered... (689 30 120 120)
|
||||
Process: 2 I/O blocked... (689 30 150 150)
|
||||
Process: 0 registered... (1372 100 700 700)
|
||||
Process: 0 I/O blocked... (1372 100 800 800)
|
||||
Process: 2 registered... (689 30 150 150)
|
||||
Process: 2 I/O blocked... (689 30 180 180)
|
||||
Process: 0 registered... (1372 100 800 800)
|
||||
Process: 0 I/O blocked... (1372 100 900 900)
|
||||
Process: 2 registered... (689 30 180 180)
|
||||
Process: 2 I/O blocked... (689 30 210 210)
|
||||
Process: 0 registered... (1372 100 900 900)
|
||||
Process: 0 I/O blocked... (1372 100 1000 1000)
|
||||
Process: 2 registered... (689 30 210 210)
|
||||
Process: 2 I/O blocked... (689 30 240 240)
|
||||
Process: 0 registered... (1372 100 1000 1000)
|
||||
Process: 0 I/O blocked... (1372 100 1100 1100)
|
||||
Process: 2 registered... (689 30 240 240)
|
||||
Process: 2 I/O blocked... (689 30 270 270)
|
||||
Process: 0 registered... (1372 100 1100 1100)
|
||||
Process: 0 I/O blocked... (1372 100 1200 1200)
|
||||
Process: 2 registered... (689 30 270 270)
|
||||
Process: 2 I/O blocked... (689 30 300 300)
|
||||
Process: 0 registered... (1372 100 1200 1200)
|
||||
Process: 0 I/O blocked... (1372 100 1300 1300)
|
||||
Process: 2 registered... (689 30 300 300)
|
||||
Process: 2 I/O blocked... (689 30 330 330)
|
||||
Process: 0 registered... (1372 100 1300 1300)
|
||||
Process: 0 completed... (1372 100 1372 1372)
|
||||
Process: 2 registered... (689 30 330 330)
|
||||
Process: 2 I/O blocked... (689 30 360 360)
|
||||
Process: 2 registered... (689 30 360 360)
|
||||
Process: 2 I/O blocked... (689 30 390 390)
|
||||
Process: 2 registered... (689 30 390 390)
|
||||
Process: 2 I/O blocked... (689 30 420 420)
|
||||
Process: 2 registered... (689 30 420 420)
|
||||
Process: 2 I/O blocked... (689 30 450 450)
|
||||
Process: 2 registered... (689 30 450 450)
|
||||
Process: 2 I/O blocked... (689 30 480 480)
|
||||
Process: 2 registered... (689 30 480 480)
|
||||
Process: 2 I/O blocked... (689 30 510 510)
|
||||
Process: 2 registered... (689 30 510 510)
|
||||
Process: 2 I/O blocked... (689 30 540 540)
|
||||
Process: 2 registered... (689 30 540 540)
|
||||
Process: 2 I/O blocked... (689 30 570 570)
|
||||
Process: 2 registered... (689 30 570 570)
|
||||
Process: 2 I/O blocked... (689 30 600 600)
|
||||
Process: 2 registered... (689 30 600 600)
|
||||
Process: 2 I/O blocked... (689 30 630 630)
|
||||
Process: 2 registered... (689 30 630 630)
|
||||
Process: 2 I/O blocked... (689 30 660 660)
|
||||
Process: 2 registered... (689 30 660 660)
|
||||
Process: 2 completed... (689 30 689 689)
|
||||
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
The program and its input and output files are described
|
||||
more fully in the <i>MOSS Scheduling Simulator
|
||||
<a href="user_guide.html">User Guide</a></i>.
|
||||
<p>
|
||||
© Copyright 2001, Prentice-Hall, Inc.
|
||||
This program is free software; it is distributed under the
|
||||
terms of the Gnu General Public License.
|
||||
See <a href="COPYING.TXT">COPYING.TXT</a>,
|
||||
included with this distribution.
|
||||
<p>
|
||||
Please send suggestions, corrections, and comments to
|
||||
Ray Ontko (<A href="mailto:rayo@ontko.com"><i>rayo@ontko.com</i></a>).
|
||||
<p>
|
||||
<i>Last updated: July 7, 2001</i>
|
||||
</body>
|
||||
</html>
|
||||
467
EOPSY/lab3/task3/work/install_windows.html
Normal file
467
EOPSY/lab3/task3/work/install_windows.html
Normal file
@ -0,0 +1,467 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>MOSS | Scheduling Simlulator | Installation |
|
||||
|
||||
Windows
|
||||
|
||||
|
||||
</title>
|
||||
</head>
|
||||
<body bgcolor="#ffffff">
|
||||
|
||||
<h1>MOSS Scheduling Simulator
|
||||
|
||||
<br>Installation on Windows 95/98/Me/NT/2000 Systems</h1>
|
||||
|
||||
|
||||
|
||||
<h2>Purpose</h2>
|
||||
|
||||
<p>
|
||||
This document provides instructions for the installation
|
||||
of the MOSS Scheduling Simulator on
|
||||
|
||||
Microsoft Windows
|
||||
|
||||
|
||||
operating systems. This procedure should be the same or similar on
|
||||
|
||||
Windows 95, 98, Me, NT, and 2000
|
||||
|
||||
|
||||
systems.
|
||||
The MOSS software
|
||||
is designed for use with
|
||||
<a href="http://www.cs.vu.nl/~ast/">Andrew S. Tanenbaum</a>,
|
||||
<a href="http://vig.prenhall.com/catalog/academic/product/1,4096,0130313580,00.html">Modern Operating Systems, 2nd Edition</a>
|
||||
(<a href="http://www.prenhall.com/">Prentice Hall</a>, 2001).
|
||||
The Scheduling Simulator was written by
|
||||
<a href="http://www.cs.earlham.edu/~odo/">Alex Reeder</a>
|
||||
(<a href="mailto:alexr@e-sa.org"><i>alexr@e-sa.org</i></a>).
|
||||
This installation guide was written by
|
||||
<a href="http://www.ontko.com/~rayo/">Ray Ontko</a>
|
||||
(<a href="mailto:rayo@ontko.com"><i>rayo@ontko.com</i></a>).
|
||||
<p>
|
||||
This installation guide only provides information about installing
|
||||
the software and testing the configuration for
|
||||
|
||||
|
||||
Windows operating systems. To install on Unix-like
|
||||
operating systems, please read the
|
||||
<a href="install_unix.html">Installation Guide for
|
||||
Unix/Linux/Solaris/HP-UX Systems</a>.
|
||||
|
||||
For more detailed information about the simulator, please read the
|
||||
<a href="user_guide.html">User Guide</a>.
|
||||
</p>
|
||||
<h2>Requirements</h2>
|
||||
|
||||
The following software components are required
|
||||
to install and use the MOSS Scheduling
|
||||
Simulator.
|
||||
<ul>
|
||||
|
||||
<li>Microsoft Windows 95, 98, Me, NT, or 2000
|
||||
|
||||
|
||||
<li>Java Development Kit (JDK) 1.0 or greater
|
||||
<li>Text program editor (e.g., notepad)
|
||||
</ul>
|
||||
|
||||
<h2>Pre-Installation</h2>
|
||||
<p>
|
||||
Before installation, you should verify:
|
||||
</p>
|
||||
<ul>
|
||||
<li>that you have a working java runtime environment,
|
||||
<li>that you have a working java development environment, and
|
||||
<li>that the working directory is in the classpath for the runtime environment.
|
||||
</ul>
|
||||
<p>
|
||||
If you're using a standard command-line java compiler, the following
|
||||
instructions will help determine if your environment is configured
|
||||
correctly.
|
||||
</p>
|
||||
<ol>
|
||||
<li>Verify that you have java installed and configured in your environment.
|
||||
|
||||
<blockquote><pre>
|
||||
C:\WINDOWS> java -version
|
||||
</pre></blockquote>
|
||||
|
||||
|
||||
You should see a message like this with possibly a different version number.
|
||||
<blockquote><pre>
|
||||
java version "1.1.8"
|
||||
</pre></blockquote>
|
||||
If you get a message like:
|
||||
|
||||
<blockquote><pre>
|
||||
Bad command or file name
|
||||
</pre></blockquote>
|
||||
|
||||
|
||||
Then java may not be installed on your system, or may not be configured
|
||||
for your use.
|
||||
<p>
|
||||
If you think that Java may already be installed on your system
|
||||
but may not be in your "path", you can find it by
|
||||
|
||||
choosing Start -> Find -> Files or Folders
|
||||
and enter "java.exe" in the "Named:" field and click the Find Now button.
|
||||
If found, make note of the directory folder in which it resides (e.g.,
|
||||
"C:\jdk1.1.8\bin").
|
||||
<p>
|
||||
While you're at it, also seach for javac.exe to see if the Java
|
||||
compiler is installed and whether it's in the same directory as
|
||||
the java.exe file.
|
||||
|
||||
|
||||
<p>
|
||||
If Java isn't available on your system, you should check with
|
||||
your instructor or system administrator. If you administer your
|
||||
own system, then you should be able to find a copy of Java
|
||||
for your operating system.
|
||||
<p>
|
||||
If you find that java is installed but not configured for
|
||||
your use, then perhaps you need to add it to your path. Consult
|
||||
your instructor or system administrator if you need help adding this
|
||||
to your path.
|
||||
</p>
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Verify that the java compiler is installed and configured in
|
||||
your environment.
|
||||
|
||||
<blockquote><pre>
|
||||
C:\WINDOWS> javac
|
||||
</pre></blockquote>
|
||||
|
||||
|
||||
If you're using a standard java command-line compiler, you should
|
||||
see a message similar to this.
|
||||
<blockquote><pre>
|
||||
use: javac [-g][-O][-debug][-depend][-nowarn][-verbose][-classpath path][-nowrite][-deprecation][-d dir][-J<runtime flag>] file.java...
|
||||
</pre></blockquote>
|
||||
If you get a message like:
|
||||
|
||||
<blockquote><pre>
|
||||
Bad command or file name
|
||||
</pre></blockquote>
|
||||
|
||||
|
||||
then the java compiler may not be installed on your system, or
|
||||
may not be configured for your use. Consult your instructor
|
||||
or system administrator.
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Verify that that the current directory is in your classpath.
|
||||
|
||||
<blockquote><pre>
|
||||
C:\WINDOWS> echo "%CLASSPATH%"
|
||||
</pre></blockquote>
|
||||
You should see a list of directories separated by semi-colons (";")
|
||||
or possibly just "". If you don't see the directory "." (a single
|
||||
period, which stands for the current directory), then you should
|
||||
add it to the classpath.
|
||||
<blockquote><pre>
|
||||
C:\WINDOWS> set CLASSPATH=.;%CLASSPATH%
|
||||
</pre></blockquote>
|
||||
|
||||
|
||||
<p><!-- --></p>
|
||||
|
||||
</ol>
|
||||
<p>
|
||||
If you have a working java runtime environment, a working java
|
||||
compiler, and the current directory is in your path, then you're
|
||||
ready to proceed with the installation.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>Installation</h2>
|
||||
|
||||
Installation of the software can be accomplished with
|
||||
these simple steps:
|
||||
<ol>
|
||||
<li>
|
||||
|
||||
Create a directory folder in which you wish to install
|
||||
the simulator (e.g., "C:\moss\sched"). You can do
|
||||
this using the Windows explorer, or from the MS-DOS
|
||||
prompt. To create the directory from the MS-DOS
|
||||
prompt:
|
||||
<blockquote><pre>
|
||||
C:\WINDOWS> cd \
|
||||
C:\> mkdir moss
|
||||
C:\> cd moss
|
||||
C:\moss> mkdir sched
|
||||
C:\moss> cd sched
|
||||
C:\moss\sched>
|
||||
</pre></blockquote>
|
||||
|
||||
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>
|
||||
|
||||
Download the self-extracting ZIP archive (sched.exe) into
|
||||
the directory folder.
|
||||
The latest release for this file can always be found at
|
||||
<a href="http://www.ontko.com/moss/sched/sched.exe">http://www.ontko.com/moss/sched/sched.exe</a>.
|
||||
|
||||
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>
|
||||
|
||||
Double-click on the file you downloaded (sched.exe),
|
||||
or invoke it using Start -> Run..., or invoke it
|
||||
from an MS-DOS command prompt:
|
||||
<blockquote><pre>
|
||||
C:\moss\sched> sched.exe
|
||||
</pre></blockquote>
|
||||
|
||||
|
||||
<p><!-- --></p>
|
||||
|
||||
</ol>
|
||||
<h2>Files</h2>
|
||||
<p>
|
||||
The directory should now contain the following files:
|
||||
</p>
|
||||
<table border="1" cellspacing="0">
|
||||
<tr>
|
||||
<th>Files
|
||||
<th>Description
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
sched.exe
|
||||
<td>Self-extracting ZIP
|
||||
|
||||
|
||||
archive which contains all the other files.
|
||||
<tr>
|
||||
<td>Common.java
|
||||
<br>Process.java
|
||||
<br>Results.java
|
||||
<br>Scheduling.java
|
||||
<br>SchedulingAlgorithm.java
|
||||
<br>sProcess.java
|
||||
<td valign="top">
|
||||
Java source files (*.java)
|
||||
<tr>
|
||||
<td>Common.class
|
||||
<br>Process.class
|
||||
<br>Results.class
|
||||
<br>Scheduling.class
|
||||
<br>SchedulingAlgorithm.class
|
||||
<br>sProcess.class
|
||||
<td valign="top">
|
||||
Compiled Java class files (*.class)
|
||||
<tr>
|
||||
<td>scheduling.conf
|
||||
<td>Sample configuration file
|
||||
<tr>
|
||||
<td>install_unix.html
|
||||
<br>install_windows.html
|
||||
<br>user_guide.html
|
||||
<td valign="top">
|
||||
Documentation
|
||||
<tr>
|
||||
<td>COPYING.TXT</td>
|
||||
<td>Gnu General Public License: Terms and Conditions
|
||||
for Copying, Distribution, and Modification
|
||||
</table>
|
||||
|
||||
<h2>Compilation</h2>
|
||||
|
||||
<p>
|
||||
The distribution includes compiled class files as
|
||||
well as the source java files. You should not need
|
||||
to recompile unless you decide to change the code.
|
||||
If you wish to compile the code,
|
||||
the following commands should work if you're using
|
||||
a Java compiler that accepts the normal "javac" command
|
||||
line.
|
||||
|
||||
<blockquote><pre>
|
||||
C:\moss\sched> javac -nowarn *.java
|
||||
</pre></blockquote>
|
||||
|
||||
|
||||
|
||||
The <tt>-nowarn</tt> flag supresses warning messges, of which
|
||||
there may be several. For backward compatability we use only
|
||||
those features of Java which have been present from the beginning,
|
||||
some of which are deprecated and are usually reported by the
|
||||
compiler with warning messages.
|
||||
|
||||
<h2>Test</h2>
|
||||
|
||||
<p>
|
||||
To test the program, enter the following commands.
|
||||
|
||||
|
||||
<blockquote><pre>
|
||||
C:\moss\sched> java Scheduling scheduling.conf
|
||||
</pre></blockquote>
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
The program will simply run the simulation based on the
|
||||
information provided in <tt>scheduling.conf</tt> and write its
|
||||
output to the <tt>Summary-Results</tt> and
|
||||
<tt>Summary-Processes</tt> files. You should see the following
|
||||
output.
|
||||
<blockquote><pre>
|
||||
Working...
|
||||
Completed.
|
||||
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
The simulation configuration information is read from a file called
|
||||
"scheduling.conf".
|
||||
The "scheduling.conf" file looks something like this:
|
||||
<blockquote><pre>
|
||||
// # of Process
|
||||
numprocess 3
|
||||
|
||||
// mean deivation
|
||||
meandev 1100
|
||||
|
||||
// standard deviation
|
||||
standdev 510
|
||||
|
||||
// process # I/O blocking
|
||||
process 100
|
||||
process 500
|
||||
process 30
|
||||
|
||||
// duration of the simulation in milliseconds
|
||||
runtime 5000
|
||||
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
If things are working correctly, the "Summary-Results" file should look
|
||||
something like this:
|
||||
|
||||
<blockquote><pre>
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 2750
|
||||
Mean: 1100
|
||||
Standard Deviation: 510
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 1372 (ms) 100 (ms) 1372 (ms) 13 times
|
||||
1 689 (ms) 500 (ms) 689 (ms) 1 times
|
||||
2 689 (ms) 30 (ms) 689 (ms) 22 times
|
||||
|
||||
</pre></blockquote>
|
||||
|
||||
and the "Summary-Processes" file should look something like
|
||||
this:
|
||||
|
||||
<blockquote><pre>
|
||||
Process: 0 registered... (1372 100 0 0)
|
||||
Process: 0 I/O blocked... (1372 100 100 100)
|
||||
Process: 1 registered... (689 500 0 0)
|
||||
Process: 1 I/O blocked... (689 500 500 500)
|
||||
Process: 0 registered... (1372 100 100 100)
|
||||
Process: 0 I/O blocked... (1372 100 200 200)
|
||||
Process: 1 registered... (689 500 500 500)
|
||||
Process: 1 completed... (689 500 689 689)
|
||||
Process: 0 registered... (1372 100 200 200)
|
||||
Process: 0 I/O blocked... (1372 100 300 300)
|
||||
Process: 2 registered... (689 30 0 0)
|
||||
Process: 2 I/O blocked... (689 30 30 30)
|
||||
Process: 0 registered... (1372 100 300 300)
|
||||
Process: 0 I/O blocked... (1372 100 400 400)
|
||||
Process: 2 registered... (689 30 30 30)
|
||||
Process: 2 I/O blocked... (689 30 60 60)
|
||||
Process: 0 registered... (1372 100 400 400)
|
||||
Process: 0 I/O blocked... (1372 100 500 500)
|
||||
Process: 2 registered... (689 30 60 60)
|
||||
Process: 2 I/O blocked... (689 30 90 90)
|
||||
Process: 0 registered... (1372 100 500 500)
|
||||
Process: 0 I/O blocked... (1372 100 600 600)
|
||||
Process: 2 registered... (689 30 90 90)
|
||||
Process: 2 I/O blocked... (689 30 120 120)
|
||||
Process: 0 registered... (1372 100 600 600)
|
||||
Process: 0 I/O blocked... (1372 100 700 700)
|
||||
Process: 2 registered... (689 30 120 120)
|
||||
Process: 2 I/O blocked... (689 30 150 150)
|
||||
Process: 0 registered... (1372 100 700 700)
|
||||
Process: 0 I/O blocked... (1372 100 800 800)
|
||||
Process: 2 registered... (689 30 150 150)
|
||||
Process: 2 I/O blocked... (689 30 180 180)
|
||||
Process: 0 registered... (1372 100 800 800)
|
||||
Process: 0 I/O blocked... (1372 100 900 900)
|
||||
Process: 2 registered... (689 30 180 180)
|
||||
Process: 2 I/O blocked... (689 30 210 210)
|
||||
Process: 0 registered... (1372 100 900 900)
|
||||
Process: 0 I/O blocked... (1372 100 1000 1000)
|
||||
Process: 2 registered... (689 30 210 210)
|
||||
Process: 2 I/O blocked... (689 30 240 240)
|
||||
Process: 0 registered... (1372 100 1000 1000)
|
||||
Process: 0 I/O blocked... (1372 100 1100 1100)
|
||||
Process: 2 registered... (689 30 240 240)
|
||||
Process: 2 I/O blocked... (689 30 270 270)
|
||||
Process: 0 registered... (1372 100 1100 1100)
|
||||
Process: 0 I/O blocked... (1372 100 1200 1200)
|
||||
Process: 2 registered... (689 30 270 270)
|
||||
Process: 2 I/O blocked... (689 30 300 300)
|
||||
Process: 0 registered... (1372 100 1200 1200)
|
||||
Process: 0 I/O blocked... (1372 100 1300 1300)
|
||||
Process: 2 registered... (689 30 300 300)
|
||||
Process: 2 I/O blocked... (689 30 330 330)
|
||||
Process: 0 registered... (1372 100 1300 1300)
|
||||
Process: 0 completed... (1372 100 1372 1372)
|
||||
Process: 2 registered... (689 30 330 330)
|
||||
Process: 2 I/O blocked... (689 30 360 360)
|
||||
Process: 2 registered... (689 30 360 360)
|
||||
Process: 2 I/O blocked... (689 30 390 390)
|
||||
Process: 2 registered... (689 30 390 390)
|
||||
Process: 2 I/O blocked... (689 30 420 420)
|
||||
Process: 2 registered... (689 30 420 420)
|
||||
Process: 2 I/O blocked... (689 30 450 450)
|
||||
Process: 2 registered... (689 30 450 450)
|
||||
Process: 2 I/O blocked... (689 30 480 480)
|
||||
Process: 2 registered... (689 30 480 480)
|
||||
Process: 2 I/O blocked... (689 30 510 510)
|
||||
Process: 2 registered... (689 30 510 510)
|
||||
Process: 2 I/O blocked... (689 30 540 540)
|
||||
Process: 2 registered... (689 30 540 540)
|
||||
Process: 2 I/O blocked... (689 30 570 570)
|
||||
Process: 2 registered... (689 30 570 570)
|
||||
Process: 2 I/O blocked... (689 30 600 600)
|
||||
Process: 2 registered... (689 30 600 600)
|
||||
Process: 2 I/O blocked... (689 30 630 630)
|
||||
Process: 2 registered... (689 30 630 630)
|
||||
Process: 2 I/O blocked... (689 30 660 660)
|
||||
Process: 2 registered... (689 30 660 660)
|
||||
Process: 2 completed... (689 30 689 689)
|
||||
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
The program and its input and output files are described
|
||||
more fully in the <i>MOSS Scheduling Simulator
|
||||
<a href="user_guide.html">User Guide</a></i>.
|
||||
<p>
|
||||
© Copyright 2001, Prentice-Hall, Inc.
|
||||
This program is free software; it is distributed under the
|
||||
terms of the Gnu General Public License.
|
||||
See <a href="COPYING.TXT">COPYING.TXT</a>,
|
||||
included with this distribution.
|
||||
<p>
|
||||
Please send suggestions, corrections, and comments to
|
||||
Ray Ontko (<A href="mailto:rayo@ontko.com"><i>rayo@ontko.com</i></a>).
|
||||
<p>
|
||||
<i>Last updated: July 7, 2001</i>
|
||||
</body>
|
||||
</html>
|
||||
BIN
EOPSY/lab3/task3/work/sProcess.class
Normal file
BIN
EOPSY/lab3/task3/work/sProcess.class
Normal file
Binary file not shown.
15
EOPSY/lab3/task3/work/sProcess.java
Normal file
15
EOPSY/lab3/task3/work/sProcess.java
Normal file
@ -0,0 +1,15 @@
|
||||
public class sProcess {
|
||||
public int cputime;
|
||||
public int ioblocking;
|
||||
public int cpudone;
|
||||
public int ionext;
|
||||
public int numblocked;
|
||||
|
||||
public sProcess (int cputime, int ioblocking, int cpudone, int ionext, int numblocked) {
|
||||
this.cputime = cputime;
|
||||
this.ioblocking = ioblocking;
|
||||
this.cpudone = cpudone;
|
||||
this.ionext = ionext;
|
||||
this.numblocked = numblocked;
|
||||
}
|
||||
}
|
||||
23
EOPSY/lab3/task3/work/scheduling.conf
Normal file
23
EOPSY/lab3/task3/work/scheduling.conf
Normal file
@ -0,0 +1,23 @@
|
||||
// # of Process
|
||||
numprocess 10
|
||||
|
||||
// mean deivation
|
||||
meandev 2000
|
||||
|
||||
// standard deviation
|
||||
standdev 0
|
||||
|
||||
// process # I/O blocking
|
||||
process 500
|
||||
process 500
|
||||
process 500
|
||||
process 500
|
||||
process 500
|
||||
process 500
|
||||
process 500
|
||||
process 500
|
||||
process 500
|
||||
process 500
|
||||
|
||||
// duration of the simulation in milliseconds
|
||||
runtime 10000
|
||||
9
EOPSY/lab3/task3/work/setUp
Executable file
9
EOPSY/lab3/task3/work/setUp
Executable file
@ -0,0 +1,9 @@
|
||||
echo "Creating ../work subdirectory"
|
||||
mkdir ../work
|
||||
cd ../work
|
||||
cp ../ftp/* .
|
||||
gzip -d sched.tgz
|
||||
tar -xvf sched.tar
|
||||
rm sched.tar
|
||||
echo ""
|
||||
echo "Now, go to the directory ../work and call 'make'"
|
||||
2
EOPSY/lab3/task3/work/stdout.txt
Normal file
2
EOPSY/lab3/task3/work/stdout.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Working...
|
||||
Completed.
|
||||
574
EOPSY/lab3/task3/work/user_guide.html
Normal file
574
EOPSY/lab3/task3/work/user_guide.html
Normal file
@ -0,0 +1,574 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Moss | Scheduling Simulator | User Guide</title>
|
||||
</head>
|
||||
<body bgcolor="#ffffff">
|
||||
<h1>
|
||||
MOSS Scheduling Simulator
|
||||
<br>User Guide</h1>
|
||||
|
||||
<h2>Purpose</h2>
|
||||
|
||||
<p>
|
||||
This document is a user guide for the MOSS
|
||||
Scheduling Simulator. It explains how to use the simulator
|
||||
and describes the various input and output files used
|
||||
by the simulator.
|
||||
The MOSS software
|
||||
is designed for use with
|
||||
<a href="http://www.cs.vu.nl/~ast/">Andrew S. Tanenbaum</a>,
|
||||
<a href="http://vig.prenhall.com/catalog/academic/product/1,4096,0130313580,00.html">Modern Operating Systems, 2nd Edition</a>
|
||||
(<a href="http://www.prenhall.com/">Prentice Hall</a>, 2001).
|
||||
The Scheduling Simulator was written by
|
||||
<a href="http://www.cs.earlham.edu/~odo/">Alex Reeder</a>
|
||||
(<a href="mailto:alexr@e-sa.org"><i>alexr@e-sa.org</i></a>).
|
||||
This user guide was written by
|
||||
<a href="http://www.ontko.com/~rayo/">Ray Ontko</a>
|
||||
(<a href="mailto:rayo@ontko.com"><i>rayo@ontko.com</i></a>).
|
||||
|
||||
<p>
|
||||
This user guide assumes that you have already installed and tested
|
||||
the simulator. If you are looking for installation information,
|
||||
please read the
|
||||
<a href="install_unix.html">Installation Guide for
|
||||
Unix/Linux/Solaris/HP-UX Systems</a> or the
|
||||
<a href="install_windows.html">Installation Guide for
|
||||
Win95/98/Me/NT/2000 Systems</a>.
|
||||
</p>
|
||||
|
||||
<h2>Introduction</h2>
|
||||
<p>
|
||||
The scheduling simulator illustrates the behavior of scheduling
|
||||
algorithms against a simulated mix of process loads. The user can
|
||||
specify the number of processes, the mean and standard deviation
|
||||
for compute time and I/O blocking time for each process, and the
|
||||
duration of the simulation. At the end of the simulation a
|
||||
statistical summary is presented. Students may also be asked to
|
||||
write their own scheduling algorithms to be used with process
|
||||
loads defined by the instructor.
|
||||
|
||||
|
||||
<h2>Running the Simulator</h2>
|
||||
|
||||
<p>
|
||||
The program reads
|
||||
a configuration file (<tt>scheduling.conf</tt>)
|
||||
and writes two output files (<tt>Summary-Results</tt>
|
||||
and <tt>Summary-Processes</tt>).
|
||||
<p>
|
||||
To run the program, enter the following command line.
|
||||
|
||||
<blockquote><pre>
|
||||
$ java Scheduling scheduling.conf
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
The program will display "Working..." while the simulation
|
||||
is working, and "Completed." when the simulation is complete.
|
||||
</p>
|
||||
<blockquote><pre>
|
||||
Working...
|
||||
Completed.
|
||||
|
||||
</pre></blockquote>
|
||||
<p>
|
||||
The simulator reads parameters from the configuration file
|
||||
("scheduling.conf").
|
||||
It creates a
|
||||
specified number of processes, each of which blocks for
|
||||
input or output after a number of milliseconds that can be specified
|
||||
for each process. Each process is allowed to run for a
|
||||
randomly generated amount of time, with the amount of time
|
||||
constrained by a specified average (mean) in milliseconds,
|
||||
and standard deviations from that average. The simulation
|
||||
may also be bounded in the total length of its run.
|
||||
<p>
|
||||
After reading the configuration file, the
|
||||
scheduling algorithm then "runs" the processes, causing
|
||||
each to block for input or output after the specified interval
|
||||
until all processes have completed their randomly generated
|
||||
amount of runtime, or until the maximum amount of runtime for
|
||||
the simulation is exceeded.
|
||||
<p>
|
||||
As the simulation proceeds, a log file ("Summary-Processes")
|
||||
is generated which shows the activity of the scheduling algorithm
|
||||
as it considers each process in the process queue.
|
||||
<p>
|
||||
After the simulation halts, a summary report ("Summary-Results")
|
||||
is generated which shows statistics for each process and for the
|
||||
simulation as a whole.
|
||||
</p>
|
||||
|
||||
<h2>The Configuration File</h2>
|
||||
|
||||
<p>
|
||||
The configuration file (<tt>scheduling.conf</tt>)
|
||||
is used to specify various parameters for the
|
||||
simulation, including:
|
||||
</p>
|
||||
<ul>
|
||||
<li>the number of processes,
|
||||
<li>the mean runtime for a process,
|
||||
<li>the standard deviation in runtime for a process,
|
||||
<li>for each process, how long the process runs before it blocks for input or
|
||||
output, and
|
||||
<li>how long the simulation should run.
|
||||
</ul>
|
||||
|
||||
<h3>Configuration File Options</h3>
|
||||
|
||||
<p>There are a number of options which can
|
||||
be specified in the configuration file. These are
|
||||
summarized in the table below.
|
||||
</p>
|
||||
|
||||
<table border="1" cellspacing="0">
|
||||
<tr>
|
||||
<th>Keyword</th>
|
||||
<th>Values</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><tt>numprocess</tt></td>
|
||||
<td valign="top"><i>n</i></td>
|
||||
<td valign="top">The number of processes to create for
|
||||
the simulation.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><tt>meandev</tt></td>
|
||||
<td valign="top"><i>n</i></td>
|
||||
<td valign="top">The average length of time in milliseconds
|
||||
that a process should execute before terminating.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><tt>standdev</tt></td>
|
||||
<td valign="top"><i>n</i></td>
|
||||
<td valign="top">The number of standard deviations from the
|
||||
average length of time a process should execute before terminating.<td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><tt>process</tt></td>
|
||||
<td valign="top"><i>n</i></td>
|
||||
<td valign="top">The amount of time in milliseconds that
|
||||
the process should execute before blocking for input or output.
|
||||
There should be a separate <tt>process</tt> directive for
|
||||
each process specified by the <tt>numprocess</tt> directive.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><tt>runtime</tt></td>
|
||||
<td valign="top"><i>n</i></td>
|
||||
<td valign="top">The maximum amount of time the simulation should run
|
||||
in milliseconds.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Sample Configuration File</h3>
|
||||
<p>
|
||||
The "scheduling.conf" configuration file looks like this:
|
||||
|
||||
<blockquote><pre>
|
||||
// # of Process
|
||||
numprocess 3
|
||||
|
||||
// mean deivation
|
||||
meandev 1100
|
||||
|
||||
// standard deviation
|
||||
standdev 510
|
||||
|
||||
// process # I/O blocking
|
||||
process 100
|
||||
process 500
|
||||
process 30
|
||||
|
||||
// duration of the simulation in milliseconds
|
||||
runtime 5000
|
||||
|
||||
</pre></blockquote>
|
||||
|
||||
<h2>The Summary-Results File</h2>
|
||||
|
||||
<p>
|
||||
The Summary-Results file contains a summary report describing
|
||||
the simulation and includes one line of summary information
|
||||
for each process. The fields and columns in the report
|
||||
are described in the following table.
|
||||
</p>
|
||||
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">Scheduling Type:</td>
|
||||
<td valign="top">The type of the scheduling algorithm used.
|
||||
The value displayed is "hard coded" in the SchedulingAlgorithm.java
|
||||
file.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">Scheduling Name:</td>
|
||||
<td valign="top">The name of the scheduling algorithm used.
|
||||
The value displayed is "hard coded" in the SchedulingAlgorithm.java
|
||||
file.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">Simulation Run Time:</td>
|
||||
<td valign="top">The number of milliseconds that the simulation
|
||||
ran. This may be less than or equal to the total amount of
|
||||
time specified by the "runtime" configuration parameter.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">Mean:</td>
|
||||
<td valign="top">The average amount of runtime for the processes
|
||||
as specified by the "meandev" configuration parameter.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">Standard Deviation:</td>
|
||||
<td valign="top">The standard deviation from the average
|
||||
amount of runtime for the processes as specified by the
|
||||
"standdev" configuration parameter.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">Process #</td>
|
||||
<td valign="top">The process number assigned to the process
|
||||
by the simulator. The process number is between 0 and n-1,
|
||||
where n is the number specified by the "numprocess" configuration
|
||||
parameter.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">CPU Time</td>
|
||||
<td valign="top">The randomly generated total runtime for the
|
||||
process in milliseconds. This is determined by the
|
||||
"meandev" and "standdev" parameters in the configuration
|
||||
file.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">IO Blocking</td>
|
||||
<td valign="top">The amount of time the process runs before it
|
||||
blocks for input or output. This is specified for each process
|
||||
by a "process" directive in the configuration file.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">CPU Completed</td>
|
||||
<td valign="top">The amount of runtime in milliseconds completed for
|
||||
the process. Note that this may be less than the CPU Time
|
||||
for the process if the simulator runs out of time as specified
|
||||
by the "runtime" configuration parameter.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top">CPU Blocked</td>
|
||||
<td valign="top">The number of times the process blocked for
|
||||
input or output during the simulation.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Sample Summary-Results File</h3>
|
||||
|
||||
<p>
|
||||
The output "Summary-Results" file looks something like this:
|
||||
</p>
|
||||
<blockquote><pre>
|
||||
Scheduling Type: Batch (Nonpreemptive)
|
||||
Scheduling Name: First-Come First-Served
|
||||
Simulation Run Time: 2750
|
||||
Mean: 1100
|
||||
Standard Deviation: 510
|
||||
Process # CPU Time IO Blocking CPU Completed CPU Blocked
|
||||
0 1372 (ms) 100 (ms) 1372 (ms) 13 times
|
||||
1 689 (ms) 500 (ms) 689 (ms) 1 times
|
||||
2 689 (ms) 30 (ms) 689 (ms) 22 times
|
||||
|
||||
</pre></blockquote>
|
||||
|
||||
<h2>The Summary-Processes File</h2>
|
||||
|
||||
<p>
|
||||
The Summary-Processes file contains a log of the actions
|
||||
taken by the scheduling algorithm as it considers each
|
||||
process in the scheduling queue.
|
||||
</p>
|
||||
<p>
|
||||
Each line in the log file is of the following form:
|
||||
<blockquote><pre>
|
||||
Process: <i>process-number</i> <i>process-status</i>... (<i>cpu-time</i> <i>block-time</i> <i>accumulated-time</i> <i>accumulated-time</i>)
|
||||
</pre></blockquote>
|
||||
<p>
|
||||
The fields in the line are described in the table below.
|
||||
</p>
|
||||
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><i>process-number</i></td>
|
||||
<td valign="top">The process number assigned to the process by the simulator.
|
||||
This is a number between 0 and n-1, where n is the
|
||||
value specified for the "numprocess" configuration parameter.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><i>process-status</i></td>
|
||||
<td valign="top">The status of the process at this point
|
||||
in time. If "registered" then the process is under consideration
|
||||
by the scheduling algorithm. If "I/O blocked", then the
|
||||
scheduling algorithm has noticed that the process is blocked
|
||||
for input or output.
|
||||
If "completed", then the scheduling algorithm has noticed
|
||||
that the process has met or exceeded its allocated execution
|
||||
time.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><i>cpu-time</i></td>
|
||||
<td valign="top">The total amount of run time allowed for this
|
||||
process. This number is randomly generated for the process
|
||||
based on the
|
||||
"meandev" and "standdev" values specified in the configuration
|
||||
file.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><i>block-time</i></td>
|
||||
<td valign="top">The amount of time in milliseconds to execute
|
||||
before blocking process. This number is specified for the process
|
||||
by the "process" directive in the configuration file.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><i>accumulated-time</i></td>
|
||||
<td valign="top">The total amount of time process has executed in
|
||||
milliseconds. (This number appears twice in the log file; one
|
||||
should be removed).
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<h3>Sample Summary-Processes File</h3>
|
||||
|
||||
<p>
|
||||
The output "Summary-Processes" file looks something like this:
|
||||
</p>
|
||||
<blockquote><pre>
|
||||
Process: 0 registered... (1372 100 0 0)
|
||||
Process: 0 I/O blocked... (1372 100 100 100)
|
||||
Process: 1 registered... (689 500 0 0)
|
||||
Process: 1 I/O blocked... (689 500 500 500)
|
||||
Process: 0 registered... (1372 100 100 100)
|
||||
Process: 0 I/O blocked... (1372 100 200 200)
|
||||
Process: 1 registered... (689 500 500 500)
|
||||
Process: 1 completed... (689 500 689 689)
|
||||
Process: 0 registered... (1372 100 200 200)
|
||||
Process: 0 I/O blocked... (1372 100 300 300)
|
||||
Process: 2 registered... (689 30 0 0)
|
||||
Process: 2 I/O blocked... (689 30 30 30)
|
||||
Process: 0 registered... (1372 100 300 300)
|
||||
Process: 0 I/O blocked... (1372 100 400 400)
|
||||
Process: 2 registered... (689 30 30 30)
|
||||
Process: 2 I/O blocked... (689 30 60 60)
|
||||
Process: 0 registered... (1372 100 400 400)
|
||||
Process: 0 I/O blocked... (1372 100 500 500)
|
||||
Process: 2 registered... (689 30 60 60)
|
||||
Process: 2 I/O blocked... (689 30 90 90)
|
||||
Process: 0 registered... (1372 100 500 500)
|
||||
Process: 0 I/O blocked... (1372 100 600 600)
|
||||
Process: 2 registered... (689 30 90 90)
|
||||
Process: 2 I/O blocked... (689 30 120 120)
|
||||
Process: 0 registered... (1372 100 600 600)
|
||||
Process: 0 I/O blocked... (1372 100 700 700)
|
||||
Process: 2 registered... (689 30 120 120)
|
||||
Process: 2 I/O blocked... (689 30 150 150)
|
||||
Process: 0 registered... (1372 100 700 700)
|
||||
Process: 0 I/O blocked... (1372 100 800 800)
|
||||
Process: 2 registered... (689 30 150 150)
|
||||
Process: 2 I/O blocked... (689 30 180 180)
|
||||
Process: 0 registered... (1372 100 800 800)
|
||||
Process: 0 I/O blocked... (1372 100 900 900)
|
||||
Process: 2 registered... (689 30 180 180)
|
||||
Process: 2 I/O blocked... (689 30 210 210)
|
||||
Process: 0 registered... (1372 100 900 900)
|
||||
Process: 0 I/O blocked... (1372 100 1000 1000)
|
||||
Process: 2 registered... (689 30 210 210)
|
||||
Process: 2 I/O blocked... (689 30 240 240)
|
||||
Process: 0 registered... (1372 100 1000 1000)
|
||||
Process: 0 I/O blocked... (1372 100 1100 1100)
|
||||
Process: 2 registered... (689 30 240 240)
|
||||
Process: 2 I/O blocked... (689 30 270 270)
|
||||
Process: 0 registered... (1372 100 1100 1100)
|
||||
Process: 0 I/O blocked... (1372 100 1200 1200)
|
||||
Process: 2 registered... (689 30 270 270)
|
||||
Process: 2 I/O blocked... (689 30 300 300)
|
||||
Process: 0 registered... (1372 100 1200 1200)
|
||||
Process: 0 I/O blocked... (1372 100 1300 1300)
|
||||
Process: 2 registered... (689 30 300 300)
|
||||
Process: 2 I/O blocked... (689 30 330 330)
|
||||
Process: 0 registered... (1372 100 1300 1300)
|
||||
Process: 0 completed... (1372 100 1372 1372)
|
||||
Process: 2 registered... (689 30 330 330)
|
||||
Process: 2 I/O blocked... (689 30 360 360)
|
||||
Process: 2 registered... (689 30 360 360)
|
||||
Process: 2 I/O blocked... (689 30 390 390)
|
||||
Process: 2 registered... (689 30 390 390)
|
||||
Process: 2 I/O blocked... (689 30 420 420)
|
||||
Process: 2 registered... (689 30 420 420)
|
||||
Process: 2 I/O blocked... (689 30 450 450)
|
||||
Process: 2 registered... (689 30 450 450)
|
||||
Process: 2 I/O blocked... (689 30 480 480)
|
||||
Process: 2 registered... (689 30 480 480)
|
||||
Process: 2 I/O blocked... (689 30 510 510)
|
||||
Process: 2 registered... (689 30 510 510)
|
||||
Process: 2 I/O blocked... (689 30 540 540)
|
||||
Process: 2 registered... (689 30 540 540)
|
||||
Process: 2 I/O blocked... (689 30 570 570)
|
||||
Process: 2 registered... (689 30 570 570)
|
||||
Process: 2 I/O blocked... (689 30 600 600)
|
||||
Process: 2 registered... (689 30 600 600)
|
||||
Process: 2 I/O blocked... (689 30 630 630)
|
||||
Process: 2 registered... (689 30 630 630)
|
||||
Process: 2 I/O blocked... (689 30 660 660)
|
||||
Process: 2 registered... (689 30 660 660)
|
||||
Process: 2 completed... (689 30 689 689)
|
||||
|
||||
</pre></blockquote>
|
||||
|
||||
<h2>Suggested Exercises</h2>
|
||||
|
||||
<ol>
|
||||
<li>Create a configuration file in which all processes run
|
||||
an average of 2000 milliseconds with a standard deviation of
|
||||
zero, and which are blocked for input or output every 500 milliseconds.
|
||||
Run the simulation for 10000 milliseconds with 2 processes.
|
||||
Examine the two output files. Try again for 5 processes. Try again for
|
||||
10 processes. Explain what's happening.
|
||||
<p><!-- --></p>
|
||||
<li>Implement a round-robin scheduling algorithm. (Hint:
|
||||
see the Run() method in SchedulingAlgorithm.java).
|
||||
<p><!-- --></p>
|
||||
</ol>
|
||||
|
||||
<h2>To Do</h2>
|
||||
|
||||
<ol>
|
||||
<li>Consider changing the configuration parameter "meandev"
|
||||
to "run_time_average". The word "dev"
|
||||
doesn't belong here. It would be nice if this were
|
||||
the average amount of time a process runs before
|
||||
blocking for input or output instead of the total runtime.
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Consider changing the configuration parameter "standdev"
|
||||
to "run_time_stddev".
|
||||
It would be nice if this were the
|
||||
number of standard deviations from the average time a
|
||||
process runs before blocking for input or output instead
|
||||
of the total runtime.
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Consider renaming the "Run()" method in SchedulingAlgorithm
|
||||
to "run()". By convention in java, method names begin with
|
||||
a lowercase letter. Also, add some internal documentation
|
||||
to SchedulingAlgorithm to facilitate understanding by students
|
||||
and instructors, and add external documentation regarding
|
||||
the implementation of new scheduling algorithms to this user guide.
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Consider adding a configuration parameter for "block_time_average"
|
||||
which would be the average amount of time in milliseconds that a process
|
||||
remains blocked for input or output before resuming execution.
|
||||
This would help eliminate the need for the "process" directive.
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Consider adding a configuration parameter for "block_time_stddev"
|
||||
which would be the number of standard deviations from the average
|
||||
time a process remains blocked for input out output before
|
||||
resuming execution. This would help eliminate the need for the
|
||||
"process" directive.
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Consider adding a configuration parameter for "quantum" which
|
||||
specifies the number of milliseconds that a process is allowed to
|
||||
execute before being re-considered by the scheduling algorithm.
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Consider modifying the format of the Summary-Processes log file.
|
||||
The total cpu time for the process is repeated in the last column
|
||||
and should be eliminated. It would be nice if the total elapsed
|
||||
milliseconds (system clock) were present at the beginning of the line
|
||||
so that we can see when things happened exactly during the simulation.
|
||||
If we switch to the meanings of the various parameters as suggested
|
||||
above, we may want to rethink the overall format of the lines as
|
||||
well.
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Consider adding a configuration parameter for "summary_file" so that
|
||||
the name for the Summary-Results file can be specified
|
||||
in the configuration file.
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Consider adding a configuration parameter for "log_file" so
|
||||
that the name for the Summary-Processes file can be
|
||||
specified in the configuration file.
|
||||
<p><!-- --></p>
|
||||
|
||||
<li>Consider adding a graphical user
|
||||
interface that allowed the user to view the simulation
|
||||
as it proceeded. This might show a summary of the
|
||||
number of blocked processes and executable processes,
|
||||
the percentage of idle time, and even the current status
|
||||
of each process. This might be enabled by a configuration
|
||||
parameter "show_graphics true". A "step" button might
|
||||
allow the simulation to proceed 1000 milliseconds at a
|
||||
time, or a "run" button might allow it to update every
|
||||
1000 milliseconds until the simulation completes. A
|
||||
"reset" button might restart the simulation to its original
|
||||
values, and there might be menu options to allow the user
|
||||
to override the parameter values given in the configuration file.
|
||||
<p><!-- --></p>
|
||||
|
||||
</ol>
|
||||
|
||||
<h2>Copyright</h2>
|
||||
|
||||
© Copyright 2001, Prentice-Hall, Inc.
|
||||
<p>
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
<p>
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
<p>
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program (see <a href="COPYING.TXT">COPYING.TXT</a>);
|
||||
if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
<p>
|
||||
|
||||
Please send suggestions, corrections, and comments to
|
||||
<a href="http://www.ontko.com/~rayo/">Ray Ontko</a>
|
||||
(<a href="mailto:rayo@ontko.com"><i>rayo@ontko.com</i></a>).
|
||||
<p>
|
||||
<i>Last updated: May 23, 2001</i>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user