Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Concurrency 11 The University of Jordan has three main gates. For security reasons, management requires to keep a current count of all individuals who are
Concurrency 11 The University of Jordan has three main gates. For security reasons, management requires to keep a current count of all individuals who are inside the campus. Each gate has a counting machine based on a card-swipe machine for entry and another for exit. 1. Write a Counter class that holds a count for all individuals in the university campus. 2. Write an Entry class representing an entrance with a card-swipe machine that increments the counter when a student passes through the entrance. 3. Write an Exit class representing an exit with a card-swipe machine that decrements the counter when a student leave through the exit door. 4. Write a test program TestCount to test three gates each fitted with one entrance and one exit threads. A gate is an object you should write and instantiate for each University physical university gate (gates needn't be threads). In your solution, synchronize parts of your program to avoid effects of interleaving and memory inconsistencies. Furthermore, use Git to document your progress
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started