multithreading - Thread BLOCK issue in java -
i have thread block issue. please me. in class, have 2 objects. 1 for synchronizing threads , other doing actual business operations.
here class
class a{ object lock = new object(); b b = new b(); public addsomething(){ synchronized(lock){ b.dothis(); } } }
i have single instance of class 'a' , multiple threads accessing method a.addsomething(). encountering thread block issue this.
the problem in b.dothis()
. if isn't well-behaved (it takes long time execute or may never finish) other threads call addsomething
blocked.
Comments
Post a Comment