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

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Sistemas Operativos I Ing. Jorge Luis Garza Ing. Jorge Luis Garza Murillo Murillo Sesin 14 Uso de Semforos para Sincronizar la Ejecucin de Instrucciones 2 Sincronizacin de la Ejecucin 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; Sincronizacin de la Ejecucin 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. 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 semforos Procedure P0;...
View Full Document

This note was uploaded on 09/30/2011 for the course SISTEMAS O 1 taught by Professor Garza during the Spring '11 term at ITESM.

Page1 / 16

SO s14 Semáforos - Sincronización de Instrucciones

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online