Os scheduling 2 | Computer Science homework help

4. PROGRAMMING

============== Now you're ready to implement the core of the scheduler, including the FIFO and Round Robin scheduling algorithms. For this purpose, you should only modify sched_impl.h and sched_impl.c. Please see scheduler.h for the descriptions of what functions you must implement. You are free to put whatever you want in the thread_info and sched_queue structures. Note that the only way that the functions you implement are made available to the main program is through the sched_impl_t structures sched_fifo and sched_rr. See dummy_impl.c for a completed example of how to fill in a sched_impl_t.

Suggested approach:

4.1 Create stub versions of all of the functions you will need to implement

in sched_impl.c, and statically initialize sched_fifo and sched_rr.

4.2 Figure out how you will implement the scheduler queue, add the

appropriate fields to struct sched_queue, and fill in the appropriate queue-related operations in the functions you created in (4.1). Remember that we provide a doubly-linked list in list.[hc].

4.3 Implement scheduler queue admission control, so that only the requested

number of threads can be in the scheduler queue at once. Create the appropriate synchronization constructs to prevent threads not in the queue from executing (look at the implementation of worker threads in scheduler.c:worker_proc()). 4.4 Implement the queue operations for selecting the next thread to execute. This will be different for FIFO vs. Round Robin scheduling.

4.5 Add in synchronization constructs to make sure only the selected thread

executes at any given time. 4.6 Fill in any gaps that might remain. When you think you're done, you can test your program using the command "make test". For more thorough testing, the fifo_var and rr_var tests accept queue_size, num_workers, and num_iterations arguments just like the

main program (but <num_iterations> is mandatory for the test case):

./scheduler -test fifo_var <queue_size> <num_workers> <num_iterations> ./scheduler -test rr_var <queue_size> <num_workers> <num_iterations>

3,034views
4.2
(195 ratings)

Related Study Guides

3 Assignment Remote Work Environments in a Global Corporation. | CSIS 343 - Cybersecurity

3. Endpoint Security Measures: Propose endpoint security measures to ensure the security of devices used for remote work. Discuss strategies for securing both corporate-owned and employee-owned device...

computer-sciencepolitical-science

Assignment 6 Security Awareness Program for a Small Business | CSIS 343 - Cybersecurity

3. Develop guidelines for secure remote work practices, considering the increasing trend of remote work. Discuss strategies for securing remote connections, using virtual private networks (VPNs), and...

human-resourcescomputer-science

Assignment 9 Cloud-Native Application Security for a Software Development Firm. | CSIS 343 - Cybersecurity

1. Develop a cloud-native application security framework for the software development firm. Discuss key considerations, such as secure coding practices, container security, and serverless architecture...

human-resourcescomputer-science

Final paper | Computer Science homework help

1. Literature Review and Analysis A. Importance of Structured Planning Kesa, (2023) underscore the importance of structured disaster recovery and planning and continuity of operations especially in hi...

art-designcomputer-science

Operating system Questions & Answers | Solutioninn.com

1. Ravi's plan is that when users click the Add Customer button in the range D3:E3, the Customers worksheet opens and Excel adds a new, blank record to the Customer table, where users can insert the.....

data-analyticscomputer-science

Proposal paper | Computer Science homework help

3. A ue rb ac h P ub lis he rs , I nc or po ra te d. A ll rig ht s re se rv ed . 152 ◾ Information Security Fundamentals References Anonymous. (2009). Self-regulation plans polarise industry. The Safe...

educationeconomics

Assignment 10 Blockchain Security Audit for a Supply Chain Company.docx | CSIS 343 - Cybersecurity

1. Provide an overview of blockchain security fundamentals. Discuss the immutability of the blockchain, consensus mechanisms, and cryptographic principles that contribute to the security of distribute...

art-designeducation

Assignment 2 Social Engineering Awareness Program for a Large Corporation | CSIS 343 - Cybersecurity

2. Propose customized social engineering awareness training modules for different departments within the corporation. Discuss tailored content for IT staff, executives, and general employees, consider...

sociologycomputer-science

Need Help With A Similar Question?

Our experts deliver perfect solutions with guaranteed A+ grades

A+
Student Grade
98%
Success Rate
12h
Delivery Time
Join 1,000+ students who got their perfect solutions
Rated 4.9/5 by satisfied students

Need Help With This Question?

Academic Expert

Subject Matter Specialist

98%
Success Rate
24/7
Support

Why Students Trust Us

  • PhD-Level Expertise
  • Original Work Guarantee
  • Better Grade or Free

"Got an A+ on my assignment. Exactly what I needed!"

Recent Student