Java Chapter 9 Muti threading ES 28

Описание к видео Java Chapter 9 Muti threading ES 28

10/12/2024
=============
What is the dead lock ?
how we can over come dead lock ?


t1 -- r1
t2--r2

1. avoid nested lock
2. use time lock


Lock lock = new Reentrent();
if(lock.tryLock(10, TimeUnits.SECONDS)){
try{

} finally{
lock.unlock();
}else{

}

}
3. Deadlock detection
================
4 minimize lock scope
5 avoid holding multiple locks
6 lock free data structure( ex == cuncurrent hashmap)

deamon thread
============

inter thread communication
===================
wait();
notify();
notifyAll();


java conurrent Package
=================
executor

Комментарии

Информация по комментариям в разработке