6 - What Is Inter Thread Communication In Java? | Multithreading | Almighty Java

Опубликовано: 25 Октябрь 2018
на канале: Almighty Java
1,836
13

#InterThreadCommunication #ThreadCommunication #Multithreading
=============================
What is Inter thread communication?

Two or more threads exchange information or communicating each other.

It is all about making synchronized threads communicate with each other.

ITC concept is one of the specialized form of inter process communication of operating system.

One thread paused for it critical section/region and another thread is allowed in same critical section/region to be executed.

It helps to avoid thread pooling (is usually implemented by loop to check some condition repeatedly. Once condition is true appropriate action is taken. This waste CPU time).

How many ways to implement ITC?

Using wait, notify or notifyAll method – Both methods are non-static, final and from object class.

Where ever use wait method, it releases a lock and allow other threads.

If thread is in wait state then only notify method can invoke that thread after invoked, thread come back in runnable state.

Methods can only be invoked from synchronized code. And must be in try catch block because it throws IOException.


На этой странице сайта вы можете посмотреть видео онлайн 6 - What Is Inter Thread Communication In Java? | Multithreading | Almighty Java длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Almighty Java 25 Октябрь 2018, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 1,836 раз и оно понравилось 13 зрителям. Приятного просмотра!