RUVIDEO
Поделитесь видео 🙏

Learn Java Programming - Thread Join Method and Thread States

In this tutorial I will demonstrate how to use the join() method. When the join() method is invoked on a child thread, the main thread is placed into one of the following states: WAITING or TIMED_WAITING. When the main thread is in the state of WAITING, it will not execute any more statements until the child thread has terminated. When the main thread is in the state of TIMED_ WAITING, it will not execute any move statements until the child thread has terminated or a certain number of milliseconds have passed. There are three overloaded versions of the join() method:
void join() causes the main thread state to change to WAITING
void join(long milliseconds) causes the main thread state to change to TIMED_WAITING for a certain number of milliseconds.
void join(long milliseconds, int nanoseconds) causes the main thread state to change to TIMED_WAITING for a certain number of milliseconds plus nanoseconds - now that is some precision!!!

Because of the way the join() method changes the behavior of thread states, it is perfect opportunity to demonstrate every thread states except BLOCKED.

NEW - A thread has been declared, but has not yet started is in this state.
RUNNABLE - In this state a thread is executing in the JVM.
BLOCKED - In this state a thread is blocked waiting for a monitor lock or intrinsic lock. I'll explain in later down the road.
WAITING - A thread that is waiting indefinitely for another thread to perform a particular action is in this state.
TIMED WAITING - A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.
TERMINATED - A thread that has exited is in this state.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Learn Java Programming - Thread Join Method and Thread States», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.