{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

SO s14 Sem&Atilde;&iexcl;foros - Sincronizaci&Atilde;&sup3;n de Instrucciones

# SO s14 SemÃ¡foros - SincronizaciÃ³n de Instrucciones

This preview shows pages 1–8. Sign up to view the full content.

Sistemas Operativos I Ing. Jorge Luis Garza Ing. Jorge Luis Garza Murillo Murillo Sesi ó n 14

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Uso de Sem á foros para  Sincronizar la Ejecuci ó n de  Instrucciones 2
Sincronización de la Ejecución de Instrucciones Supongamos que tenemos las siguientes instrucciones contiguas en un programa: 3 a := 5 b := a / 3 Grafo de Precedencia a := 5; b := a/3;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Sincronización de la Ejecución de Instrucciones a := 5 b := a / 3 Grafo de Precedencia Procedure P1; Begin a := 5; V(semaf_a); End; Procedure P2; Begin P(semaf_a); b := a / 3; End; Semaf_a /* Programa principal */ Begin InitSemaphore ( semaf_a, 0 ); Parbegin P1; P2; Parend end.
Ejemplo 2 Procedure P0; Procedure P2; begin begin read (a); write (c); c := a + b; write (d) end; end; Procedure P1; begin read (b); d := a / b; end; /* Programa Principal */ begin Parbegin P0; P1; P2; Parend end.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Read (a) Read (b) c := a + b d := a / b Write (c) Write (d) Grafo de Precedencia P0 P2 P1
Ejemplo ya preparado para operaciones con semáforos Procedure P0; Procedure P2; begin begin read (a); write (c); c := a + b; write (d); end; end; Procedure P1; begin read (b); d := a / b; end; /* Programa Principal */ begin Parbegin P0; P1; P2; Parend end.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}