diff --git a/documentation/current/solutions/concurrent-computing/concurrent-eiffel-scoop/scoop-examples/faneuil-hall.wiki b/documentation/current/solutions/concurrent-computing/concurrent-eiffel-scoop/scoop-examples/faneuil-hall.wiki index e518a2e4..e073dfd2 100644 --- a/documentation/current/solutions/concurrent-computing/concurrent-eiffel-scoop/scoop-examples/faneuil-hall.wiki +++ b/documentation/current/solutions/concurrent-computing/concurrent-eiffel-scoop/scoop-examples/faneuil-hall.wiki @@ -13,6 +13,33 @@ The scenario in the Faneuil Hall example involves a number of immigrants waiting =Highlights= +The primary actors here are the immigrants, the judge, and the spectators, model by classes IMMIGRANT, JUDGE, and SPECTATOR, respectively. Some of the common behavior of these classes is abstracted into a deferred parent class, ACTOR. In addition to the actor classes, there is a class HALL that represents Faneuil Hall itself, and a root class that sets everything up and starts the processing. There is only one judge, but there will be a maximum combined number of immigrants and spectators. The specific number of immigrants versus spectators varies at random from one execution to the next. + +Although not really considered an actor here (at least not a descendant of class ACTOR) the class HALL plays a critical role in managing the concurrent actions of the immigrants, spectators, and the judge. HALL includes many status queries which, when used in preconditions in features of the other actors, constitute [[Concurrent Eiffel with SCOOP#Preconditions|uncontrolled precondition clauses]] which when false will cause the calling processor to wait until the condition becomes true. For example, consider the following status query from class HALL: + + + immigrants_ready: BOOLEAN + -- Are immigrants ready? + do + Result := immigrant_count = ready_immigrant_count + end + + +This query is used by the JUDGE when preparing to sit and administer oaths to the immigrants: + + + take_place (a_hall: separate HALL) + -- Prepare to confirm. + require + immigrants_ready: a_hall.immigrants_ready + do + print (out + " taking place%N") + a_hall.sit_judge + end + + +The judge will take his place only when all the immigrants present have checked in and are ready to take the oath. +