Find Jobs
Hire Freelancers

C Program.....

$10-30 USD

Geschlossen
Veröffentlicht vor etwa 7 Jahren

$10-30 USD

Bezahlt bei Lieferung
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; }
Projekt-ID: 13244337

Über das Projekt

10 Vorschläge
Remote Projekt
Aktiv vor 7 Jahren

Möchten Sie etwas Geld verdienen?

Vorteile einer Ausschreibung auf Freelancer

Legen Sie Ihr Budget und Ihren Zeitrahmen fest
Für Ihre Arbeit bezahlt werden
Skizzieren Sie Ihren Vorschlag
Sie können sich kostenlos anmelden und auf Aufträge bieten
10 Freelancer bieten im Durchschnitt $110 USD für diesen Auftrag
Avatar des Nutzers
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 Tag
4,9 (203 Bewertungen)
7,3
7,3
Avatar des Nutzers
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 Tag
4,9 (105 Bewertungen)
6,9
6,9
Avatar des Nutzers
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 Tag
4,9 (66 Bewertungen)
6,4
6,4
Avatar des Nutzers
let's work together............................................................................................................................................................
$30 USD in 1 Tag
5,0 (1 Bewertung)
1,2
1,2
Avatar des Nutzers
-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 Tagen
0,0 (0 Bewertungen)
0,0
0,0

Über den Kunden

Flagge von UNITED STATES
United States
0,0
0
Zahlungsmethode verifiziert
Mitglied seit Feb. 25, 2017

Kundenüberprüfung

Danke! Wir haben Ihnen per E-Mail einen Link geschickt, über den Sie Ihr kostenloses Guthaben anfordern können.
Beim Senden Ihrer E-Mail ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.
Registrierte Benutzer Veröffentlichte Jobs
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Vorschau wird geladen
Erlaubnis zur Geolokalisierung erteilt.
Ihre Anmeldesitzung ist abgelaufen und Sie wurden abgemeldet. Bitte melden Sie sich erneut an.