Find Jobs
Hire Freelancers

Semaphores

$10-30 USD

In corso
Pubblicato più di 7 anni fa

$10-30 USD

Pagato al completamento
CSCE 5640, Fall 2016 Project #1 Due: 11-9-2016 For this project you may be working in groups of two. Each member of your group must sign up on the corresponding project sheet in order to receive a grade. Your task is to implement a semaphore-based solution to the problem stated below. Consider a system with N blocks of storage, each of which holds one unit of information (e.g. an integer, character, or employee record). Initially, these blocks are empty and are linked onto a list called freelist. Three threads communicate using shared memory in the following manner: Shared Variables: freelist, list-1, list-2: block (where block is some data type to hold items) Thread-1 var b: pointer to type block; while (1) { b:= unlink(freelist); produce_information_in_block(b); link(b, list1); } Thread-2 var x,y: pointer to type block; while (1) { x:=unlink(list-1); y:=unlink(freelist); use_block_x_to_produce info_in_y(x, y); link(x, freelist); link(y, list-2); } Thread-3 var c: pointer to type block; while(1) { c:=unlink(list-2); consume_information_in_block(c); link(c, freelist); } Using the POSIX library, rewrite the code for the threads, using semaphores to implement the necessary mutual exclusion and synchronization. The solution must be deadlock-free and concurrency should not be unnecessarily restricted.
Rif. progetto: 12010191

Info sul progetto

Progetto a distanza
Attivo 7 anni fa

Hai voglia di guadagnare un po'?

I vantaggi delle offerte su Freelancer

Imposta il tuo budget e le scadenze
Fatti pagare per il lavoro svolto
Delinea la tua proposta
La registrazione e le offerte sui lavori sono gratuite

Info sul cliente

Bandiera: UNITED STATES
hyderabad, United States
5,0
15
Metodo di pagamento verificato
Membro dal dic 8, 2015

Verifica del cliente

Grazie! Ti abbiamo inviato tramite email il link per richiedere il tuo bonus gratuito.
Non è stato possibile inviarti l'email. Riprova per piacere.
di utenti registrati di lavori pubblicati
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Caricamento anteprima
Autorizzazione per la geolocalizzazione concessa.
La tua sessione è scaduta ed è stato effettuato il log out. Accedi nuovamente per piacere.