Question
c code for this scenario Booking (Hypermarket) system time slots will be represented as array every time slot will allow only few number of users
c code for this scenario
Booking (Hypermarket) system
time slots will be represented as array
every time slot will allow only few number of users to book this slot (counter for the number of users who booked this slot)
Assumption: when the user enters for the first time, he will be given a chance to request specific timing slot. If the slot is full, then the system automatically assigns him to the next available timing slot. For this sake, we introduce a priority number for every user. All users who enter the system at the first time will have priority =0. When the user fails to reserve the slot that he requested, then the system promotes him by adding +1 to his priority.
race condition: we have so many users are trying to book specific timing slot.
syn: for a specific timing slot that has more than one user trying to book, the users who can enter and reserve first are the ones with higher priority. When such user is done, it signals to the rest to come in to book the slot
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