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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!