Can any one please clear me on this doubt,
If there are two threads running and there are two methods, one is synchronized and the other is not..
first thread is accessing the non synchronized method (which is a lengthy one) of the object and it's on it's half way and suddenly the second thread comes to access the synchronized method of that object.. which means it's going to lock the object..
Now in this scenario what happens..... two threads are accessing two different methods but when the object is locked by the second thread, what will happen to the first thread and the method it was processing...
If there are two threads running and there are two methods, one is synchronized and the other is not..
first thread is accessing the non synchronized method (which is a lengthy one) of the object and it's on it's half way and suddenly the second thread comes to access the synchronized method of that object.. which means it's going to lock the object..
Now in this scenario what happens..... two threads are accessing two different methods but when the object is locked by the second thread, what will happen to the first thread and the method it was processing...