{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

SO s14 Semáforos - Sincronización de Instrucciones

SO s14 Semáforos - Sincronización de Instrucciones

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

View Full Document Right Arrow Icon
Sistemas Operativos I Ing. Jorge Luis Garza Ing. Jorge Luis Garza Murillo Murillo Sesi ó n 14
Background image of page 1

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

View Full Document Right Arrow Icon
Uso de Sem á foros para  Sincronizar la Ejecuci ó n de  Instrucciones 2
Background image of page 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;
Background image of page 3

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

View Full Document Right Arrow Icon
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.
Background image of page 4
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.
Background image of page 5

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

View Full Document Right Arrow Icon
Read (a) Read (b) c := a + b d := a / b Write (c) Write (d) Grafo de Precedencia P0 P2 P1
Background image of page 6
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.
Background image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}