Find Jobs
Hire Freelancers

C Program.....

$10-30 USD

Closed
Posted about 7 years ago

$10-30 USD

Paid on delivery
Implement a solution via semaphores and threads to the n reader 1 writer problem. Fairness always matters. You will accept the number of readers from the command line. In no case will more than 12 readers be used and always at least 1 reader will be used. Each reader must access a shared counter value 250000000 times in the C.S. Note, it does not update anything, just “reads”. For convenience code is below that will do this. A reader reads just one time and a writer writes just one time. Each reader needs to print its name when done. The writer will update the value 25000 times and print done. The writer will also set a shared flag, in-cs, when it enters the critical section and reset it just before it leaves the critical section. The reader must, upon entering the critical section, check this flag and write an error message if the flag is set. You can help us out for testing by using a version of the following code to give the writer a chance to run while readers are also running. So, start it in the midst of the readers. k = (int) (numOfReaders/2); for(i = 0; i < k; i++){ pthread_create(&readers[i], &attr[0], reader_thread, (void*) i); } /* Create the writer thread */ pthread_create(&writer[0], &attr[0], writer_thread, NULL); for(i = k ; i < numOfReaders ; i++) { pthread_create(&readers[i], &attr[0], reader_thread, (void*) i); } void relaxandspendtime() { int i; for(i = 0; i < 250000000; i++) i=i; }
Project ID: 13244337

About the project

10 proposals
Remote project
Active 7 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
10 freelancers are bidding on average $110 USD for this job
User Avatar
I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environment. I made many great projects using c++, for example, I made the tools which could convert java codes into c++ scripts, of course garbage collection included, this was very similar to a compiler, and was very complex. I also made our own mobile game using c++, I can show you the demo of client, if you like. I am very proficient in java also. I have a very good review on Freelancer.com, I never miss a project once I accept the job, you can check my review. Trust me, please let expert help you.
$100 USD in 1 day
4.9 (203 reviews)
7.3
7.3
User Avatar
Hi, I'm a OS expert experienced C/C++/ObjC developing. I can develop almost kinds of C/C++/ObjC codes for any OS : Windows, Linux, MAC OS X... I can use almost of develop libraries such as QT, MFC, boost... and ant IDE tools that you prefer. I had done several developing tasks related operating systems or applications. I can also develop IPhone/IPad Apps with Corona SDK, Obj C, QT and Swift Please check my profile and contact with me. I think we can discuss more details for our sake. Best regards!
$84 USD in 1 day
4.9 (105 reviews)
6.9
6.9
User Avatar
I m software engineer. I have read the description and I would like to work for you. For further details please inbox me. Thank you
$150 USD in 1 day
4.9 (66 reviews)
6.4
6.4
User Avatar
let's work together............................................................................................................................................................
$30 USD in 1 day
5.0 (1 review)
1.2
1.2
User Avatar
-Prior experience with C programming -Prior experience with Operating System -Familiar to semaphores and Reader Writer Problem -Studied about the problem in my deegre programme
$20 USD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
United States
0.0
0
Payment method verified
Member since Feb 25, 2017

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.