Monday 3 March 2014

Introduction to multithreading in C#.net.

What is threading?

Every application runs with at least one thread. So what is a theme? A thread is simply a process. My guess is that the word comes from the Greek thread supernatural mythology muses weaving loom threads, where each thread represents a time path of someone's life. If you mess with that thread, and then bothers the tissue of life or change the process of life. On the computer, a thread is a process moving through time. The process performs sets of sequential steps, each step executing a line of code. Because the steps are sequential, each step has a given amount of time. The time it takes to complete a series of steps is the amount of time it takes to complete each step of programming.

What are multithreading?

 Generally programming application most used single threaded .That means there was only one thread in entire application. you could never do run A until completing B process. A program starts at step 1 and continues sequentially step 2 ,step 3, step 4 still not complete all step .A multithreading application allows you to run several threads.

Implement step for multitreading :



When to thread

Multi Threading is used most often in situations when programs  run more efficiently. For example, say your Form window program contains a method (call method_A) inside that takes more than a second to run and need to run repeatedly. Well, if the entire program was run in a single thread, you would notice the times when button presses do not work properly, or his writing was a little slow .common scenario that would have threading is a messaging system. If you have many messages that are sent to your application, you need to capture, while the main processing program is running and properly distributed.You can not efficiently capture a series of messages while you are doing any heavy processing, because otherwise you may miss messages. Multi-threading can also be used in an assembly line fashion in multiple processes running simultaneously. For example once process collects data in a thread, one process filters the data, and a process matches the data against a database. Each of these scenarios are common uses for multithreading and significantly improve performance of similar applications running on a single thread.

0 comments:

Post a Comment