Find Jobs
Hire Freelancers

C Program.....

$10-30 USD

Suljettu
Julkaistu noin 7 vuotta sitten

$10-30 USD

Maksettu toimituksen yhteydessä
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; }
Projektin tunnus (ID): 13244337

Tietoa projektista

10 ehdotukset
Etäprojekti
Aktiivinen 7 vuotta sitten

Haluatko ansaita rahaa?

Freelancerin tarjouskilpailun edut

Aseta budjettisi ja aikataulu
Saa maksu työstäsi
Kuvaile ehdotustasi
Rekisteröinti ja töihin tarjoaminen on ilmaista
10 freelancerit tarjoavat keskimäärin $110 USD tätä projektia
Käyttäjän 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 1 päivässä
4,9 (203 arvostelua)
7,3
7,3
Käyttäjän 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 1 päivässä
4,9 (105 arvostelua)
6,9
6,9
Käyttäjän 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 1 päivässä
4,9 (66 arvostelua)
6,4
6,4
Käyttäjän avatar
let's work together............................................................................................................................................................
$30 USD 1 päivässä
5,0 (1 arvostelu)
1,2
1,2
Käyttäjän 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 3 päivässä
0,0 (0 arvostelua)
0,0
0,0

Tietoja asiakkaasta

Maan UNITED STATES lippu
United States
0,0
0
Maksutapa vahvistettu
Liittynyt helmik. 25, 2017

Asiakkaan vahvistus

Kiitos! Olemme lähettäneet sinulle sähköpostitse linkin, jolla voit lunastaa ilmaisen krediittisi.
Jotain meni pieleen lähetettäessä sähköpostiasi. Yritä uudelleen.
Rekisteröitynyttä käyttäjää Ilmoitettua työtä yhteensä
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Ladataan esikatselua
Lupa myönnetty Geolocation.
Kirjautumisistuntosi on vanhentunut ja sinut on kirjattu ulos. Kirjaudu uudelleen sisään.