Peer Model

Auch Workcrew genannt
Peer Model
- kein Chef
- gleichzeitiges Erledigen der Arbeiten
- ein Thread muss alle anderen erstellen
- bei Boss / Worker ist Boss für Input verantwortlich
- bei Peer:
-- kennt Input im Voraus (Zuständigkeit) eigener Weg um Input zu bekommen
-- teilt Input mit anderen

  1. main() {
  2.      pthread_create(... thread1, task1 ...);
  3.      pthread_create(... thread2, task2 ...);
  4.      ...
  5.      signalisiere start
  6.      warte auf beendigung aller threads
  7.      aufräumen
  8. }
  9. task1() {
  10.      auf start warten
  11.      aufgabe ausführen, synchnonizieren
  12.      fertig
  13. }

Anwendungsbereich

- fest oder gut definierte Menge von Eingaben
- voneinander unabhängige Aufgaben mit wenig Koordination

Beispiele

- Matrix Operationen
- Parallel suchen in DBs
- Primzahlen
- Generatoren
- Simulationen

- da kein Boss muss Zugang zu I/O synchronisiert sein
- bei viel Sync. -> Blockaden -> langsam
- deshalb geteilte Ressourcen minimieren

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Use <fn>...</fn> to insert automatically numbered footnotes.
  • You can use the <go> tags just like the <a> for nicer urls.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.