This content has been marked as final. Show 2 replies
->There are two classes class A and Class B with a main() method.One main() method? Or one each?
They start thread in main().Each? One of them? Both of them? In the same JVM? Different JVMs?
if class A is running the Checker thread'The Checker thread' is meaningless. Do you mean a thread with that name? A thread whose Runnable is a class of that name? A class of that name which extends Thread?
then class B thread should wait unless and until class A finishes its executionIts execution of that thread? Its entire JVM?
->If Checker thread in Class A is sleeping then thread of class B should not start. Class B thread only start when class A thread is stopped.Again, which thread? Identified how? In the same JVM? Its own JVM?
You need to specify your problem a lot better than this.
More importantly than any of the above, why? What is the actual problem being addressed? Thread safety? Single instance of the application? Sequential execution of tasks?
What should I do to implement such synchronization between class A and B?