top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How does thread synchronization occurs inside a monitor ?

+1 vote
168 views

What levels of synchronization can you apply ?

posted Jan 13, 2015 by Shyam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

The JVM uses locks in conjunction with monitors. A monitor is basically a guardian that watches over a sequence of synchronized code and ensuring that only one thread at a time executes a synchronized piece of code. Each monitor is associated with an object reference. The thread is not allowed to execute the code until it obtains the lock.

answer Jan 14, 2015 by Karthick.c
Similar Questions
+1 vote

As JVM uses the primitive or time slicing scheduling techniques for thread scheduling. Is it possible to know our exiting JVM using which technique for thread scheduling?

+4 votes

Design an algorithm to accept a string from the user. Count and print the number of times each character occurs in the given string. Example –
input string = "malayalam"
Output must be –
m – 2
a – 4
l – 2
y - 1

...