Question
(20 Points) Jim plans to test out a new idea using a very low-cost wireless station that he can install outside his dorm room window:
(20 Points) Jim plans to test out a new idea using a very low-cost wireless station that he can install outside his dorm room window: users can upload or download their MP3-encoded songs from their laptops, anytime, anywhere on campus. However, the cheap wireless technology he's acquired is half-duplex: all users can either upload or download--never both at once. The following questions investigate your ability to help Jim in particular ways.
(a) (5 Points): Jim intends to test out the basic idea, with just two users, of whom only one can upload or download one song at a time. To impress him, you whip out the following simple semaphore-based synchronization code that only works for two users, along with an explanation of why it works correctly:
(b) (5 Points): Jim's next development step requires that multiple users be able to download songs simultaneously, or upload songs simultaneously. So, you produce new semaphore-based code as follows, with a suitable technical explanation of its workings:
(c) (5 Points): While testing out the "simultaneous" strategy, you sadly discover that bandwidth isn't unlimited. Therefore, you have to limit the number of simultaneous active upload or download users to 100. Your new semaphore-based code follows, with a good explanation of its function:
(d) (5 Points): What synchronization problems remain with your "Step (c)" solution, and how might you solve them?
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