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

Published: 25 October 2018
on channel: 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.


On this page of the site you can watch the video online 6 - What Is Inter Thread Communication In Java? | Multithreading | Almighty Java with a duration of hours minute second in good quality, which was uploaded by the user Almighty Java 25 October 2018, share the link with friends and acquaintances, this video has already been watched 1,836 times on youtube and it was liked by 13 viewers. Enjoy your viewing!