Da traduttori professionisti, imprese, pagine web e archivi di traduzione disponibili gratuitamente al pubblico.
the overflow condition is thus identified by the impossibility of decreasing the o semaphore and the underflow condition by the impossibility of decreasing th u semaphore.
la condizione di overflow è rappresentata dall'impossibilità di aggiungere elementi all'interno del buffer mentre la condizione di underflow è rappresentata dal buffer vuoto e dall'impossibilità di leggere un ulteriore elemento.
the first (number 0) acts as a buffer access lock and has a maximum value of 1, while the other two manage the overflow and underflow conditions.
uno ci servirà per la mutua esclusione dal buffer e avrà valori comprei tra 0 e 1 mentre gli altri due gestiranno le condizioni di overflow e underflow.
here we initialize the value of the semaphores: the first to 1 because it controls the access to an exclusive resource, the second to the length of the buffer (given on the command line) and the third to 0, as said before about over- and underflow.
qui inizializziamo i valori dei semafori. il semaforo numero zero prende il valore 1 poichè gestisce l'accesso in mutua esclusione alla risorsa, il secondo prende la lunghezza del buffer e il terzo zero poichè non vi sono elementi nel buffer alla partenza.