Java Multithreading Tutorial for Beginners #2: Why do we need multiple threads ?

Опубликовано: 17 Февраль 2019
на канале: Genuine Coder
9,018
106

In this chapter, we will talk about the requirement of Threads. Threads require some extra handling/coding and changes in your program code. Then why should we use it ?

We will create a single Java Swing based application and will see the effect of running a complex loop in main thread. When we run processor intensive code on main thread, the processor will not be available for GUI rendering. This will cause application to not respond to user interactions and thereby cause crashes.

We will see how using a simple thread we could get rid of the application freezing.

We have 2 threads in this application.
1. Main thread
2. Thread that computes the sum from 1..N


You can find the source code of this chapter in the following GitHub repository.
https://github.com/afsalashyana/Java-...


Website:-
https://www.genuinecoder.com

#Multithreading
#GenuineCoder
#Java


На этой странице сайта вы можете посмотреть видео онлайн Java Multithreading Tutorial for Beginners #2: Why do we need multiple threads ? длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Genuine Coder 17 Февраль 2019, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 9,018 раз и оно понравилось 106 зрителям. Приятного просмотра!