Find Jobs
Hire Freelancers

classical synchronization problems in order to see how the (semi) critical section problem could be implemented using binary and counting semaphores.

$10-30 USD

Awarded
Posted over 8 years ago

$10-30 USD

Paid on delivery
In this lab you will simulate one of the classical synchronization problems in order to see how the (semi) critical section problem could be implemented using binary and counting semaphores. The lab is due in 2 weeks, 29th October 2015. 5 processes are characterized by 3 readers and 2 writers. Up to two reader processes can be inside their critical section without any writer process. For writer process to go into its critical section, it should check whether there is any reader or writer process is in the critical section. Critical section in this problem is reading shared data buffer for reader and updating shared data buffer for writer processes. It is up to you to implement any shared data for readers and writers but you have to specify clearly following things in your sample output. • When reader or writer enters its critical section, it has to report whether there are any reader(s) or writer(s) other than itself. • You may print out the data you read or write when you implement real buffer. (Optional) • You have to print out “Panic Messages” when the rules behind this semi critical section problem are not observed. In your main program, you run the random number generator function to choose process to execute. The chosen process starts (resumes) execution and after one instruction, it will be returned. (You should force each process run exactly one instruction then returns and waiting for its turn.) You can implement this using switch statement in C++. Each process is one big switch statement and will be returned after each instruction. You need to keep track of program counter of each process to resume at the right place once it will be chosen to run by keeping global counter variable per process. Subproject 1: You should implement binary and counting semaphores as studied in the class for this project. Subproject 2: You should implement testandset operation as studied in the class for this project.
Project ID: 8807747

About the project

2 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
2 freelancers are bidding on average $30 USD for this job
User Avatar
Hi there! I can make 3 versions, one with “Panic Messages”, the second one with semaphores and one with a lock based on testandset. I'll write it in C, nice code with comments. Is that what you want? If you confirm this soon enough, I can do it tomorrow and you'll have it ready in the evening. If you want, we can have a short call on skype and discuss details. Regards, Wojtek Dziewięcki
$35 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
United States
5.0
1
Member since Oct 31, 2015

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.