The Ornamental Gardens problem

The Ornamental Gardens problem

A large ornamental garden is open to members of the public who can enter through either one of two turnstiles. The management want to determine how many people there are in the garden at any one time. They require a computer system to provide this information.

Garden

East

Turnstile

West

Turnstile

Count

In the following, we will represent each turnstile by a thread and provide an object to store the count. Each turnstile displays the number of people in the park.

Previous slide Next slide Back to the first slide View Graphic Version