PROCEDURE dekker_s_algorithm IS TYPE process_enumeration IS(first,second); favored_process : process_enumeration; p1_wants_to_enter, p2_wants_to_enter : boolean; PROCEDURE process_one IS BEGIN LOOP p1_wants_to_enter := true; WHILE p2_wants_to_enter LOOP IF favored_process = second THEN p1_wants_to_enter := false; WHILE favored_process = second LOOP NULL; END LOOP; p1_wants_to_enter := true; END IF; END LOOP; critical_section_one; favored_process := second; p1_wants_to_enter := false; other_stuff_one; END LOOP; END process_one; PROCEDURE process_two IS BEGIN LOOP p2_wants_to_enter := true; WHILE p1_wants_to_enter LOOP IF favored_process = first THEN p2_wants_to_enter := false; WHILE favored_process = first LOOP NULL; END LOOP; p2_wants_to_enter := true; END IF; END LOOP; critical_section_two; favored_process := first; p2_wants_to_enter := false; other_stuff_two; END LOOP; END process_two; BEGIN p1_wants_to_enter := false; p2_wants_to_enter := false; favored_process := first; PARBEGIN process_one; process_two; PAREND; END dekker_s_algorithm;
Algorithme de Dekker
Suite de Fibonacci Exemple d'itération en ADA
Suite de Fibonacci Exemple de récursion en ADA
Hello world
Tous les extraits
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
9 mots clés dont 5 définis manuellement (plus d'information...).
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)