123ArticleOnline Logo
Welcome to 123ArticleOnline.com!

ALL >> Computer-Programming >> View Article

What Is The Use Of Threads In Java?

By Author: priya
Total Articles: 5

Why use Multithreading in Java?

There is only one thread in Java application and it is none other than the main thread which executes the main method in Java. JVM uses lots of threads eg: daemon threads are typically used for garbage collections. A new user thread can be added like an application developer for making your application efficient and faster.

1) Two parallel running successful events :

The ideal examples of multithreading in Java are Swing and Java FX GUIs. An action is taken by the user in a common GUI application for instance loading games modules from hard disk or downloading a file from the network. These tasks are little bit time consuming but GUI should not be stopped to avoid the application hang. Thus there is a need for a separate thread for doing the time-consuming task and provide relevant messages to the user for doing other tasks.

2) Take the benefit of CPU Power :

For enhancing the performance of the application by using full CPU power multiple threads are used in Java. For instance, if only 1 among the 32 core CPU is used by them for serving 1000 clients and assuming that your application is CPU bound you can enhance the performance to 32 times by 32 threads which will use all 32 cores of your CPU.

3) For reducing response time :

Multiple threads can be used to decrease response time with speedy processing by splitting a problem into smaller chunks and process them with the help of multiple threads.

4) To serve multiple clients simultaneously :

Multiple threads significantly enhance an application's performance in a client's application. In a single server application, the only client can connect to a server at a time whereas multiple servers mean more than one client can connect to a server.

Total Views: 10Word Count: 299See All articles From Author

Computer Programming Articles

1. Using Selenium For Short And Long Of Waits In Web Applications
Author: Siyaram Ray

2. Cross Currency Payment In Oracle Fusion Financials Payment Work Bench :
Author: Vishal

3. Python Oops Concepts
Author: Infocampus

4. Wearable Computing Devices App Development
Author: mtoge

5. Font Family In Css
Author: Tipsfor123456 Tipsfor

6. List Property In Css
Author: Tipsfor123456 Tipsfor

7. Border Property In Css
Author: Tipsfor123456 Tipsfor

8. Text Propeety In Css
Author: Tipsfor123456 Tipsfor

9. Introduction And Features Of Selenium Webdriver
Author: Siyaram Ray

10. Box Modal Property
Author: Tipsfor123456 Tipsfor

11. Background Property In Css
Author: Tipsfor123456 Tipsfor

12. Link Property In Css
Author: Tipsfor123456 Tipsfor

13. Float Property In Css
Author: Tipsfor123456 Tipsfor

14. Inline And Block Property In Css
Author: Tipsfor123456 Tipsfor

15. Padding Property In Css
Author: Tipsfor123456 Tipsfor

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: