var msgnocomment = 'Enter a comment'; var txt_norequest = 'Can not complete the request.';
C# Threading
Created by
Wednesday, April 27, 2016

Threading is a concept in Computer Science that a “thread” is simply the component of a process. Programs can be single-threaded or multi-threaded programs.There are plenty of resources online that will explain in finer detail the threading concept so for the purpose of this article i will provide some simple code that you could execute on a console application to further display a thread in progress.

thread

 

So above we have a simple console application that starts a single threaded application. We instantiate a Thread Object and call that objects start method. So the application begins with the main thread t printing our method for Write2. At the same time the main thread prints 1. On a multicore process machine the two threads can execute in parallel.  The result is of repeated segments of 1′s and 2′s. This is due to the way in which the console handles concurrent requests.

 

Below is a pretty simple use case for threading in a software situation.

Tags:
c#
threading
0 points
1 2 3 4 5

I like

You like

Report

You have reported
Reasons
Cancel
0 comments