public class BarrierMap
- extends Object
This class shows how to synchronice a bunch of people who perform many activities.
The main requirement is that no one will be performing activity
every body finised activity
n. Each person is called
This is an example of a centralized authority that lets many processes rund
concurrently without knowing that they are executing in parallel. In a distributed
systems this central authority does not exist.
This is an example of Map/Reduce. In the "Map" face, in programa "main()",
the syncrhonization semaphores are set up and the Bob processes are created.
The "Reduce" is executed after all the Bob processes are done.
- In the main program, a loop is used to perform each activity.
BarrierMap.reduce is created anew on each cicle to initialize
it with one permito for each Bobs. Thi semaphore is used to know when all the
Bobs are done.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static void main(String args)
- Main program.