0% found this document useful (0 votes)
64 views

Projec Description

This project involves implementing two different CPU scheduling algorithms: First Come First Serve (FCFS) and Round Robin (RR). For project 1, students will create a multithreaded program to validate Sudoku puzzles by checking rows, columns and subgrids using threads. For project 2, students will simulate CPU scheduling by reading task information from a file and scheduling tasks based on the selected algorithm. The program will output the Gantt chart-style scheduling and compute average waiting time, turnaround time and CPU usage. Requirements include correctly implementing the algorithms, handling input/output, and providing documentation.

Uploaded by

saeed khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Projec Description

This project involves implementing two different CPU scheduling algorithms: First Come First Serve (FCFS) and Round Robin (RR). For project 1, students will create a multithreaded program to validate Sudoku puzzles by checking rows, columns and subgrids using threads. For project 2, students will simulate CPU scheduling by reading task information from a file and scheduling tasks based on the selected algorithm. The program will output the Gantt chart-style scheduling and compute average waiting time, turnaround time and CPU usage. Requirements include correctly implementing the algorithms, handling input/output, and providing documentation.

Uploaded by

saeed khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CS330

Project
Select one of the following Programming Projects. Project description of each of the following
problems can be found in the next pages.

Suggested Programming Problems:


1. Sudoku Solution Validator
2. CPU Scheduling Simulator

Project Instructions:
• This is a group project. Each team can have a maximum of 3 members in project 1 and a
maximum of 5 members in project 2.
• Plagiarized projects will receive a ZERO!
• All group members should cooperate in tackling the problem.

Submission Requirements: 2 submissions are required

1. Individual submission: each team member needs to submit her individual report through
Moodle summarizing what she have learned from this project and describing her contributions to
the project in detail. i.e. I worked on task A and completed it using…
2. Group submission: A Group leader needs to submit a zip file including the entire required
documents listed below through Moodle. A zipped file titled with the first name of each member
e.g. sarah_Tasneem_Ghada.zip
a) A C program file (NOT PASTED IN WORD DOCUMENT) that implements the
solution to the selected problem.
b) A group report that has the following sections:
1) Introduction: Include a statement of the problem to be investigated and solved,
why you chose to solve this problem, a brief statement of the general method of
approach to the problem, and expected results.
2) Design: Describe the algorithms that were designed. Use pseudo code to avoid
ambiguity.
3) Implementation: The goal of this section is to explain the most important parts
of the code.
4) Results: Show the output of your code (A screenshot of your output) with
detailed explanation. Don’t just cut and paste the screen. You must show that you
understand what is being presented.
5) Conclusion and future improvements: Describe to which degree your answer
meets the requirements of the project. Show how your code can be improved.
6) References: if used.
CS330

Project 1—Sudoku Solution Validator

A Sudoku puzzle uses a 9 × 9 grid in which each column and row, as well as each of the nine 3 ×
3 subgrids, must contain all of the digits 1 · · · 9. This project consists of designing a multithreaded
application that determines whether the solution to a Sudoku puzzle is valid.
There are several different ways of multithreading this application. One suggested strategy is to
create threads that check the following criteria:
• A thread to check that each column contains the digits 1 through 9
• A thread to check that each row contains the digits 1 through 9
• Nine threads to check that each of the 3 × 3 subgrids contains the digits 1 through 9
This would result in a total of eleven separate threads for validating a Sudoku puzzle. However,
you are welcome to create even more threads for this project. For example, rather than creating
one thread that checks all nine columns, you could create nine separate threads and have each of
them check one column.
Passing Parameters to Each Thread
The parent thread will create the worker threads, passing each worker the location that it must
check in the Sudoku grid. This step will require passing several parameters to each thread.
Returning Results to the Parent Thread
Each worker thread is assigned the task of determining the validity of a particular region of the
Sudoku puzzle. Once a worker has performed this check, it must pass its results back to the parent.
One good way to handle this is to create an array of integer values that is visible to each thread.
The ith index in this array corresponds to the ith worker thread. If a worker sets its corresponding
value to 1, it is indicating that its region of the Sudoku puzzle is valid. A value of 0 would indicate
otherwise. When all worker threads have completed, the parent thread checks each entry in the
result array to determine if the Sudoku puzzle is valid.
CS330

Project 2: CPU Scheduling Simulator

1. Project Objectives:
This programming project is to simulate a few CPU scheduling policies discussed in the class. You
will write a C program to implement a simulator with different scheduling algorithms. The
simulator selects a task to run from ready queue based on the scheduling algorithm. Since the
project intends to simulate a CPU scheduler, so it does not require any actual process creation or
execution. When a task is scheduled, the simulator will simply print out what task is selected to
run at a time. It outputs the way similar to Gantt chart style.
2. Project Descriptions:
The selected scheduling algorithms to implement in this project are 1) First Come First Serve
(FCFS), and 2) Round Robin (RR). Detailed algorithms are already described in class slides and
textbook Chapter 5.
The simulator first reads task information from input file and stores all data in a data structure.
Then it starts simulating one scheduling algorithm in a time-driven manner. At each time unit (or
slot), it adds any newly arrived task(s) into the ready queue and calls a specific scheduler algorithm
in order to select appropriate task from ready queue. When a task is chosen to run, the simulator
prints out a message indicating what process ID is chosen to execute for this time slot. If no task
is running (i.e. empty ready queue), it prints out an “idle” message. Before advancing to the next
time unit, the simulator should update all necessary changes in task and ready queue status.
❖ Task Information File
The task information will be read from an input file. The format is pid, arrival_time , and
burst_time. All of fields are integer type where pid is a unique numeric process ID. Arrival_time
is the time when the task arrives in the unit of milliseconds. Burst_time is the CPU time requested
by a task, in the unit of milliseconds. The time unit for arrival_time, burst_time and interval is
millisecond.
❖ Command-line Usage and Examples
Usage: proj2 input_file [FCFS|RR] [time_quantum]
where input_file is the file name with task information described in section 2.1. FCFS, and RR are
names of scheduling algorithms. The time_quantum only applies to RR. FCFS is nonpreemptive
while RR is preemptive. The last argument is needed only for RR.
Examples:
proj2 input.1 FCFS ; FCFS scheduling with the data file “input.1”
proj2 input.1 RR 2 ; Simulate RR scheduling with time quantum 2 milliseconds (4th parameter is
required even for quantum 1 millisecond) with the data file “input.1”
3. Requirements:
The project requires to simulate FCFS, and RR scheduling for given tasks and to compute the
average waiting time, turnaround time and overall CPU usage. You can find their definitions in
textbook as well as in class slides.
[1] Implement scheduling algorithm for FCFS, and RR. The program should schedule tasks and
print progress of task every unit time (millisecond).
[2] Print statistical information. As soon as all tasks are completed, the program should compute
and print 1) average waiting time, 2) average turnaround time and 4) overall CPU usage.
CS330

Below Expectation Developing Meeting Expectation Accomplished


0 Expectation 2 Expectation
1 3

The use of POSIX Does not use Pthreads / Implements with few Implements with no Implements with no
Thread Library for ready queue and input errors. errors. errors.
project 1/ file. Student fails to answer Student answers most Student answers all
Ready queue Student fails to answer some questions. questions questions.
implementation and all questions.
use of input file for
project 2
Running program Does not run. Runs with many errors. Runs with few errors. Runs with no errors.

Clear declarations and Does not provide a clear Does provide clear Does provide clear Does provide clear
definition of Declaration and Declarations and declaration and declarations and
Variables and definition. definitions for some definition for most of definitions.
functions. parts of the code. the code.

Documentation The documentation does The documentation is The documentation The documentation is
(code comments) not help the reader simply comments consists of embedded well written and clearly
understand the embedded in the code comment and some explains what the code is
code. with some simple header simple header accomplishing and how.
comments separating documentation that is A uniform
routines. somewhat useful in documentation
understanding the code. standard” is followed
throughout.

Testing The program is The program produces The program works and The program works and
producing incorrect correct results but does produces the correct meets all of the
results. not display them results and displays specifications..
correctly. them correctly. It also
meets
most of the other
specifications.

Report The project report is The project report is The project report is The project report is
poorly written, doesn’t somewhat good. Include somewhat good. Include good. Include all of the
include work some of the sections: some of the sections: sections: work
distributions, solution work distributions, work distributions, distributions, solution
logic description. solution logic solution logic logic description.
Does not provide description. description. It provides detailed
explanation to the It provides simple It provides good explanation to the
source code and explanation to the explanation to the source code and
screenshots. source code and one source code and screenshots.
screenshots. screenshots.

Individual report Student contribution to Student contribution to Student contribution to Student contribution to
the project is not stated the project is vaguely the project is explained the project is well
and list few generic info explained and listing and discussed some of explained in the report
about what the student some generic info about what the student learned and discussed all what
learned what the student learned the student learned

Presentation and Presentation is an Presents about part of Presents about the whole Presents about the whole
questions answering unclear or not the program and in an project but in an unclear project in
understandable; unclear manner manner an organized manner.
And student did not And student tried to And student tried to Student answered
answer to questions. answer but unclearly answer but unclearly correctly and clearly.
and wrongly. (partly)

You might also like