Abstract
In this article I will discuss the basics of multithreading and how it could be effective over a single thread application. It also includes the advantages and disadvantages of multithreading. The article includes the complete .NET project for creating a simple multithreaded application.
In this article I will discuss the basics of multithreading and how it could be effective over a single thread application. It also includes the advantages and disadvantages of multithreading. The article includes the complete .NET project for creating a simple multithreaded application.
Introduction
Threads are also known as lightweight processes. However, if we go into depth then we would know that a thread is not actually a process; rather it provides ways for executing different parts of a program. Now let us discuss what it actually means by multithreading. Multithreading (as the name suggests multi+threading) is nothing but an efficient execution of multiple threads at a time to enhance the performance of the application. For example, we are doing a file copy operation with a status bar on UI indicating the completion percentage. Here we need to keep track of how much file size is copied and at the same time we also need to advance the progress bar accordingly. This can not be done efficiently in a single thread and you have to use multiple threads.
The above example shows just one instance where we are forced to use multithreading. However, when we are not forced we can also use this for the betterment of the application performance. And of course, all this depends on how effectively the thread is implemented in an application. Most of the developers do not use multithreaded applications and continue with a single thread. However, the efficient use of threads can give birth to a highly powerful application.
Requirements | |||||||||||||||||||||||||||
Visual Studio .NET 2003 | |||||||||||||||||||||||||||
Multithreading | |||||||||||||||||||||||||||
Whenever an application runs, it runs under a main thread. However, running a single thread can sometimes lead to unnecessary performance and locking issues. So if the application can be broken into multiple threads without hampering the flow of the main thread, then using it is always better.
|
No comments:
Post a Comment
Leave your suggession & comment...