Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

=+ 5. What are two factors that cause the SAS curve to shift?

Answered: 1 week ago