I have this coursework due in 5 hours and am having trouble implementing binary semaphores. My task is basically from the given semaphore class derive a binary semaphore class and make use of 3 threads, threadX, threadY, and threadZ to repeatedly form the pattern Z,X,Y. (threadX prints X, Y prints Y and Z prints Z). The binary semaphores are like a lock for these threads so as to ensure that they always print out the pattern in the same order repeatedly until system.exit(0); is called. How would i go about this?
Comments
Leave a comment