Write a program that creates a certain number of sellerthreads thatattempt to sell all the available tickets. There is a global variablenumTickets which tracks the number of tickets remaining to sell.We will create many threads that all will attempt to sell tickets untilthey are all gone. Each thread will exit after all the tickets havebeen sold.E.g. if we have 4 tickets and 2 sellerthreads then output should be likeSeller #1 sold one (3 left)Seller #0 sold one (2 left)Seller #1 sold one (1 left)Seller #0 sold one (0 left)Seller #1 noticed all tickets sold! (I sold 2myself)Seller #0 noticed all tickets sold! (I sold 2myself)Done
Do this using semaphores and c++ linux based
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here