Professional Documents
Culture Documents
Ubaid Assignment 2 (TPL) - 1
Ubaid Assignment 2 (TPL) - 1
Assignment No: #2
Assignment Question:
Cooperation synchronization in Java is implemented with the wait, notify, and notify All
methods, all of which are defined in Object, the root class of all Java classes. All classes
except Object inherit these methods. Every object has a wait list of all of the threads
that have called wait on the object.
In Ada, cooperation synchronization is required between two tasks that when the
second task must wait for the first task to finish executing before it may proceed.
Because the access mechanisms are part of the monitor, implementation of a monitor can
be made to guarantee synchronized access by allowing only one access at a time. Calls to
monitor procedures are implicitly blocked and stored in a queue if the monitor is busy at
the time of the call.
More precisely, if a thread calls a monitor procedure, this thread will be blocked if there is
another thread executing in the monitor. Those threads that were not granted the
entering permission will be queued to a monitor entry queue outside of the
monitor.Morover the Flow chat diagram below in Java Example :
Assignment #2 By Ubaid Ullah Aleem