Question
Star Cineplex is the first multiplex cinema theatre in Bangladesh. It also gives its viewers the facility to check available tickets and book shows via
Star Cineplex is the first multiplex cinema theatre in Bangladesh. It also gives its viewers the facility to check available tickets and book shows via online ticket booking system. When the program is run, it creates a certain number of threads that attempt to sell all available tickets. However, the program needs to make sure that while booking the same show by various users, the total number of available seats are error free and there is not any data loss.
Using POSIX threads, mutex locks, and semaphores implement a solution that synchronizes the activities of the users. The total number of users, the number of tickets, and number of shows are passed as command line arguments. Once a user thread finishes booking a show, it should terminate. Once all the user threads are terminated, the main program should be terminated. Your program should work for any number of users, tickets and shows. Allocate memory for data structures dynamically based on the input parameter(s).
Use C programmming Language to solve this problem(No Other Language)
Explain the code clearly in every steps
Show input and output
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