12.07.2015 Views

Spis treœci - Patrz

Spis treœci - Patrz

Spis treœci - Patrz

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

process TPROC;var ZBIÓRT: array[l..T] of integer;export function ZAMIEN(m: integer): integer;var n: integer;beginn := MinElem(ZBIORT);if m n then ZBIÓRT := ZBIÓRT + {m} - {n};ZAMIEŃ := nend; {ZAMIEŃ}beginend; {TPROC}Po zakończeniu podziału proces obsługujący będzie nadal oczekiwał na wywołanieprocedury ZAMIEŃ.10.4.2 Korygowanie logicznych zegarówWysyłanie czasu do wszystkich procesów najłatwiej zrealizować za pomocą rozgłaszania.Dzięki temu zmniejszamy liczbę komunikatów przesyłanych w sieci.const N = ?;M = ?;process P(i: 1..N);var z, c, t: integer;beginc := 0;z := i;while true do beginwlasne_sprawy(i);c := c + 1;if c = z then begint := KONTROLER(i).DAJCZAS;if t > c then c := t + 1;z := c + M;after KONTROLER(*).WEZCZAS(c) doendendend; {P}until trueprocessKONTROLER(i: l..N);var c: integer;export function DAJCZAS: integer;beginDAJCZAS := cend; {DAJCZAS}export procedure WEZCZAS(t: integer);beginif t > c then c := tend; {WEZCZAS>beginc := 0end; {KONTROLER}{nie interesują nas odpowiedzi}266

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!