Hi All,
In Dan's Threads mock exam there some points I am not clear about :
1. If execution of a block completes abruptly , then lock is released .
How does execution completes abruptly ? Is it exception thrown etc ...
2. We should not ynchronize on a method local variable , because each
thread has its own instance of the object and lock ?
If all threads have a seperate instance of object and lock , then all threads can acquire lock of the object at the same time . Please clarify this , if possible with some example.
3. Yeild() is used to give chance to other thread to run . But does it means that other thread should be of same priority ? Can a thread of lower priority run on any platform , if yeild is invoked ?
4. What is the priority Daemon threads ? Is it platform specific or always MIN_PRIORITY ?
5. Also initailly does main() thread has NORMAL_PRIORITY ? Is normal priority always = 5 on all platforms ?
Thanks,
Lavjeet