Diferencia entre revisiones de «Práctica Semáforos (Sistemas Operativos)»

De Cuba-Wiki
Sin resumen de edición
Línea 2: Línea 2:
<br>a)
<br>a)
<pre>
<pre>
A B C   
A       B       C   
P( A )  P( B )  P( C )   
P( A )  P( B )  P( C )   
... ... ...   
...     ...     ...   
V( B )  V( C )  V( A )   
V( B )  V( C )  V( A )   


Línea 15: Línea 15:
<br>b)
<br>b)
<pre>
<pre>
A B C   
A       B       C   
P( A ) P( B ) P( C )   
P( A )   P( B )   P( C )   
P( msg ) P( msg )   
P( msg ) P( msg )   
... ... ...   
...     ...     ...   
V( A ) V( A )   
V( A )   V( A )   
V( msg ) V( C ) V( B )   
V( msg ) V( C )   V( B )   


Inicio
Inicio
Línea 31: Línea 31:
<br>c)
<br>c)
<pre>
<pre>
A B C   
A       B       C   
P( A )  P( A )  P( C )   
P( A )  P( A )  P( C )   
... ... ...   
...     ...     ...   
V( C )  V( C )  V( A )   
V( C )  V( C )  V( A )   



Revisión del 23:07 30 mar 2007

Ejercicio 01[*]:


a)

A       B       C  
P( A )  P( B )  P( C )  
...     ...     ...  
V( B )  V( C )  V( A )  

Inicio
A = n > 0  
B = 0  
C = 0


b)

A        B        C  
P( A )   P( B )   P( C )  
P( msg ) P( msg )  
...      ...      ...  
V( A )   V( A )  
V( msg ) V( C )   V( B )  

Inicio
A = n > 0  
msg = 0  
B = 1  
C = 0  


c)

A       B       C  
P( A )  P( A )  P( C )  
...     ...     ...  
V( C )  V( C )  V( A )  

Inicio
A = n > 0  
C = 0  

Ejercicio 02:

Ejercicio 03:


a)
b)

Ejercicio 04:

Ejercicio 05[*]:


a) Hay un deadlock, porque Z espera que se incremente B, y B nunca se va a incrementar, porque eso lo hace Y (que no se va a ejecutar)
b) Se podrian invertir los primeros dos P's de Y y Z
c) Me parece que anda bien (por algo lo di como solucion del b :P)
d)

Ejercicio 06[*]:


a)
b)

Ejercicio 07[*]:

MMMM. a que apunta este ejercicio??

Ejercicio 08:

Ejercicio 09:

Ejercicio 10:

Ejercicio 11[*]:

Es muy pedorra esta solucion????

A  B  C  
P( A )  P( msg )  P( msg )  
P( A )    
...  ...  ...  
V( msg )  V( A )  V( A )  
V( msg )    

Inicio
A=2  
msg=0  

Ejercicio 12[*]:

A  B  C  
  P( exc )  
P( A )  P( B )  P( C )  
  P( C )  
  V( exc )  
...  ...  ...  
V( B )  V( C )  V( A )  
V( B)    

Inicio
A=1  
B=0  
C=0  

Ejercicio 13[*]: