Find Jobs
Hire Freelancers

C program.

$10-30 USD

W trakcie realizacji
Opublikowano około 7 lat temu

$10-30 USD

Płatne przy odbiorze
mplement 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; } You will again hand in the program on [login to view URL] by running /usr/local/os/turn in4 and carefully following the instructions. Make sure your name is in the code file in comments!
Identyfikator projektu: 13240874

Informację o projekcie

2 ofert
Zdalny projekt
Aktywny 7 lat temu

Szukasz sposobu na zarobienie pieniędzy?

Korzyści ze składania ofert na Freelancer.com

Ustal budżet i ramy czasowe
Otrzymuj wynagrodzenie za swoją pracę
Przedstaw swoją propozycję
Rejestracja i składanie ofert jest bezpłatne
Przyznano:
Awatar Użytkownika
$15 USD w 0 dzień
0,0 (0 opinii)
0,0
0,0
2 freelancerzy składają oferty o średniej wysokości $20 USD dla tej pracy
Awatar Użytkownika
Hello, Sir Weebside Inc. is a professional freelancer service provided to worthy clients like you. We can provide our best developers to provide you High-Quality Product with 100% Delivery Rate, 100% Satisfaction. Having Experts in Java, C / C++ , C# , VB , .NET , SQL, MySQL, and Python Programming Language and Frameworks made us capable to bid here. We can provide any service of any caliber within Hours. CHAT WITH US TO START RIGHT NOW. BEST DEVELOPERS AROUND. WITH HIGHEST QUALITY DELIVERED WITHIN TIME. WITHIN BUDGET. CLICK CHAT TO START CLICK CHAT TO START CLICK CHAT TO START CLICK CHAT TO START CLICK CHAT TO START
$25 USD w 1 dzień
4,9 (107 opinii)
5,4
5,4

O kliencie

Flaga UNITED STATES
United States
0,0
0
Zweryfikowana metoda płatności
Członek od lut 25, 2017

Weryfikacja Klienta

Dziękujemy! Przesłaliśmy Ci e-mailem link do odebrania darmowego bonusu.
Coś poszło nie tak podczas wysyłania wiadomości e-mail. Proszę spróbować ponownie.
Zarejestrowani Użytkownicy Całkowita Liczba Opublikowanych Projektów
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Wczytywanie podglądu
Udzielono pozwolenia na Geolokalizację.
Twoja sesja logowania wygasła i zostałeś wylogowany. Proszę, zalogować się ponownie.