Uploaded by Sumon Kumar

Tutorial5

advertisement
UCS1526 Programming Paradigms
Tutorial – 5
Dr. R. Kanchana
===========================================================================
The reader-writer problem can be stated as follows: A shared memory location
can be concurrently read by any number of tasks, but when a task must write to
the shared memory location, it must have exclusive access. Write a Java program
for the reader-writer problem.
2. Define semaphores in Java and use them to provide both cooperation and
competition synchronization in the shared-buffer example.
1.
Submit the Java code along with the snapshot of output.
Download