Describe the possible issues and how you solve the issues

Assignment Help Operating System
Reference no: EM133136850

Question: Write a program in C language, called simulator.c that does the following.

a) The parent thread creates six child threads, i.e., thread A, B, C, D, E, and F that respectively runs the FCFS, SSTF program, SCAN, C-SCAN, LOOK, and C-LOOK disk schedulers. Threads A, B, C, D, E, and F block while waiting for input from the parent thread.

b) The parent thread waits for an input from the user. The input can be either a file name, e.g., input!, or "QUIT". When the parent thread receives "QUIT" as input, it tells threads A, B, C, D, E, and F to terminate, and terminates itself. Each child thread should print the following message (Thread_ID is the ID of the thread):
Thread ID has terminated

c) For each file name, e.g., input 1 , the program does the following:

The parent thread stores the contents of the input, e.g., input 1 , in a buffer, called bufferl, and signals thread A, B, C, D, E, and F to read buffer!. The parent thread then blocks while waiting for results from threads A, B, C, D, E, and F, i.e., the seek time. Notice that the parent thread acts as a producer and threads A, B, C, D, E, and F as the consumers for buffer! of size n+3; bufferl stores only the content of input file that has n disk requests and three other information; see the format of input. The simulator must solve any possible synchronization/critical section issues among the threads. You must describe the possible issues and how you solve the issues. Use pthread_createO, pthread_mutex_lockO, pthread_mutex_unlockO, pthread_cond_waito, and pthread_cond_signalO in your program.

Each child thread that has computed the seek time writes the result in another buffer, called buffer2, and signals the parent thread to read the result. Then the child thread blocks waiting for another input from the parent thread. For this case, the parent thread acts as a consumer and threads A, B, C, D, E, and F as the producers for a bounded buffer of size 1, i.e., buffer2 can store only one seek time at a time. The simulator must solve any possible synchronization/critical section issues among the threads. You must describe the possible issues and how you solve the issues. Use pthread_createO, pthread_mutex_lock(), pthread_mutex_unlock(), pthread_cond_waitO, and pthread_cond_signalO in your program.

After the parent thread receives the results from the six threads, it should print the results, e.g.,

For input1:
FCFS: 640.
SSTF: 236.
SCAN: 236.
C-SCAN: 386.
LOOK: 222.
C-LOOK: 326.

You MAY make your own assumptions/requirements other than those already given. However, YOU HAVE TO DOCUMENT ANY ADDITIONAL ASSUMPTIONS/LIMITATIONS FOR YOUR IMPLEMENTATIONS.

Reference no: EM133136850

Questions Cloud

Compute the controllable margin and the return on investment : Increase sales $151,200, with no change in the contribution margin percentage. Compute the controllable margin and the return on investment for 2020
What will likely happen to the price of joseph bonds : If, after March 1, 2022, the U.S. Federal Reserve increases interest rates, what will likely happen to the price of Joseph's bonds in the marketplace
The structure of scientific revolutions : Evaluate Kuhn's perspective on scientific revolutions in terms of how it connects with Arbnor and Bjerke's delineation of the research models.
By how much did the conversion cost eup for the month : By how much did the conversion cost EUP for the month of October using average method exceed the conversion EUP for the same month using FIFO method
Describe the possible issues and how you solve the issues : Solve any possible synchronization/critical section issues among the threads. You must describe the possible issues and how you solve the issues
The future of healthcare : Identify the factors that will be required for future change in the health care industry pertaining to quality improvement, patient safety, and risk management.
Determine the trend percentage for net income : Benowitz Company's net income was $150,000 for 2015, $162,500 for 2016, and $167,520 for 2017. Determine the trend percentage for net income
Management perspective in labour relations : What qualities do you feel are necessary to be a successful Labour Relations practitioner on the management side?
Can we make changes to the restricted balance : Can we make changes to the restricted balance if we decide we have restricted too much or too little? If so, how can this be done

Reviews

len3136850

5/1/2022 11:16:46 PM

Hello, I want the thread solution to be written in C89, However, I do not want the code to have global values and not multiply returns. I want the make file to run the solution. FCFS, SSTF program, SCAN, C-SCAN, LOOK DO NOT WRITE THEM. I have already wrote the function for them However, i will give the solution for FCFS and the point all the threads to that function, as i will fix that later. The aim is to write the threads stuff

Write a Review

Operating System Questions & Answers

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd