15. Using Threads
Threading is the way in which a software application carries on multiple processes at the same time. A thread in Java is a unit of program execution that runs concurrently with other threads.
Threads are commonly used in GUI applications. In a GUI application, one thread might be listening for input from the keyboard or other input devices, while another thread is processing the previous command. Networking is another common area in which you will find multithreading used. In network programming, one thread might be listening for connection requests, while another thread processes a previous request. Timers are also common uses of threads. A timer can be started as a thread running independently from the rest of an application. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access