Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Operating System Expert

This assignment is based on Programming Project 6.40 in Silbershatz. Implement the ProducerXConsumer program according to the instructions for Project 6.40 for both Linux and Win32 threads. (1) However BEFORE you add any synchronization to your code use sleep()/usleep() calls to force your code to produce as many different types of synchronization bugs as possible.  Use the output produced by your program and for your Linux implementation only also use 'strace -f' to explain how and where in your code the synchronization bugs occur.  Be sure to use the command line argument for strace - see the man pages for details on this Each of your threads should fprint out a line of output to stderr when it is first started, and again when each buffer of input/output is processed.  

Submit code and annotated  test output for these experiments explaining where the race conditions occur.

NEXT, modify your code by adding appropriate synchronization (mutex locks and/or signal semaphores and/or count semaphores) so that it always executes correctly.   Use diff on Linux & comp on Windows to verify that the input & output files are identical by annotating your trace output clearly and concisely and using diff/comp to compare the contents of the input & output files.  Explain the logic of how you synchronized your code in your design documentation by submitting high level pseudocode with semaphore synchronization (init, p(), v()) and an explanation of the logic that you used; (2)  submit wellXcommented source code and annotated output (including strace listings) to demonstrate that your code is executing correctly, despite the sleep/usleep commands from the previous part.

Run your final program with 3 buffers (each of which is 13 bytes long),  6 producers, 3 consumers and a file that contains about 200 bytes; annotate & submit this output. (3) For the third part of this assignment, modify your synchronization so that a deadlock condition occurs, and document this situation by explaining in your design documentation how deadlock was produced in your code and how it can be avoided.

Operating System, Computer Science

  • Category:- Operating System
  • Reference No.:- M9528224

Have any Question?


Related Questions in Operating System

Discussion question this research assignment will give

Discussion Question : This research assignment will give further information on the nature and workings of multi-tasking and multi-processing operating systems. All information reported in this assignment is to be in the ...

Question description of lasa in this assignment you will

Question: Description of LASA: In this assignment, you will select a real-world operating system (can be for a PC, server, tablet, handheld, or embedded device). You will introduce the operating system and its components ...

Question students working at individual pcs in a computer

Question : Students working at individual PC's in a computer laboratory send their files to be printed by a server that spools the files on its hard disk. Under what conditions may a deadlock occur if the disk space for ...

Question 1answer the following questions 10 marks a

Question 1 Answer the following questions: 10 marks a. Consider the following page reference string: 3, 1, 4, 1, 2, 3, 5, 3, 2, 1, 2,5, 4, 3, 5, 2, 4,2, 5,3 Using the above page reference string display the contents of t ...

Catalog course descriptionin this course students carry out

Catalog Course Description In this course students carry out independent research in a significant technical area of information, network, and computer security. The student is to investigate a technical area, research i ...

Foundation of information technologyresearch types of

Foundation of Information Technology Research types of operating systems that are currently available and provide a scenario in which the operating system you chose would be appropriate to be used in this situation. Expl ...

Taskyour job in this assignment is to create two virtual

Task Your job in this assignment is to create two Virtual machines each running a different but the latest distribution of Linux e.g. Ubuntu Server and CentOS. Each of these VM's is to offer services to a user base. The ...

Question what do you see as the major differences between

Question : What do you see as the major differences between UNIX/Linux and other operating systems, such as Windows and Mac OS X? The response must be typed, single spaced, must be in times new roman font (size 12) and m ...

Question you are a security administrator responsible for

Question: You are a security administrator responsible for providing secure configuration requirements for new laptop deployments. After reading Module 2 of Certified Secure Computer User v2exercises, apply the configura ...

State the required answer precisely and then provide proper

State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. Briefly describe the following concepts and indicate how they are related in the context ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As