Threading in .Net is an important topic. I have seen people unable to understand the nuances of processes, threads and how they are related in .Net and also in general.
In the series of articles around threading, I will try to present the concepts in the simplest way possible so that it can knock to your head directly and help you understand easily.
Threading is a broad topic that goes with operating systems. So before beginning the threading in .Net let's understand a few core or underlying concepts as in the following.
How applications and processes are related
When we start an application, system resources and memory are assigned to it. The separation of these boundaries are based on memory and the resources are called a process.
An application can be allocated one or more processes, where each process is differentiated based on allocated resources, data and execution code.
Processes
A process can be defined as an instance of the application. While running it uses assigned program code, system resources and data. A process further can be broken into more than one thread based on application design and the operating system of the machine.
Threads
A thread can be defined as the smallest possible part of the process that can be handled or controlled independently by a scheduler. If I make an analogy to it then you can relate it to atom in the world of matters/particles.
How processes and threads are related
Every thread is a part of a process. Multiple threads within a process share the memory, execution instruction, context data and other system resources.
The following picture explains the relationship among applications, processes and threads.
As said above, each process has its own execution instruction/sequence, context, memory and other system resources. The part or constituents that makes threads to work can be defined as in the following.
- Registers (in the CPU)
- Memory Stack
- Container to store threads state/context (in other words TLS)
TLS
I assume you understand what context switching is in threading. In simple words, it's switching the focus to various threads involved in the system based on certain algorithms (you might have heard of Round Robin and so on). In this scenario, the outgoing thread needs to store its state information to be able to start form the same place (again when it gets the slot). Basically this is done by TLS that uses a program counter that tells the thread which instruction to execute next.
Multithreading
Well, that's enough for the first tutorial. :) I will explain multithreading in the next article.
Please share your comments.

Prakash TripathiPosted Jun 14, 2016, 11:34 PM
Thnx a lot Shishir for finding them useful. I will keep on presenting the complex concepts into easy way.
Shishir RoyPosted Jun 14, 2016, 10:47 PM
I gone thru almost all your docs. The way u represent the concept/logic its really appreciable.
Prakash TripathiPosted Mar 6, 2016, 10:30 PM
Thnx Kumaresh
Prakash TripathiPosted Mar 6, 2016, 10:30 PM
Thnx Karthiga.
Kumaresh RajalingamPosted Mar 6, 2016, 8:26 PM
good one
Kumaresh RajalingamPosted Mar 6, 2016, 8:26 PM
Nice explanation
Sr KarthigaPosted Mar 6, 2016, 8:14 PM
good one
Sr KarthigaPosted Mar 6, 2016, 8:14 PM
Nice explanation
Prakash TripathiPosted Jan 21, 2016, 5:41 AM
Thnx SL.
Prakash TripathiPosted Jan 21, 2016, 5:40 AM
Thnx PEDRO.
Prakash TripathiPosted Jan 21, 2016, 4:40 AM
Thnx Narasimha.
Prakash TripathiPosted Jan 21, 2016, 4:38 AM
Thnx Pankaj.
Prakash TripathiPosted Jan 21, 2016, 4:35 AM
Thnx Humayun.
Prakash TripathiPosted Jan 21, 2016, 4:33 AM
Thnx Gowtham.
Prakash TripathiPosted Jan 21, 2016, 4:32 AM
Thnx Sibeesh.
Prakash TripathiPosted Jan 21, 2016, 4:30 AM
Thnx Jaipal.
Jaipal ReddyPosted Jan 21, 2016, 12:17 AM
Nice article sir.
Sibeesh VenuPosted Dec 28, 2015, 5:17 AM
Nice Share
Gowtham RajamanickamPosted Dec 28, 2015, 5:10 AM
good..
Humayun Kabir MamunPosted Dec 7, 2015, 4:23 AM
Nice...
Pankaj Kumar ChoudharyPosted Jul 19, 2015, 12:39 PM
Nice Article Sir........
Narasimha Reddy ChennupalliPosted Jul 18, 2015, 2:09 PM
Nice article
PEDRO RENE GONZALEZPosted Jun 7, 2015, 2:54 AM
nice, thx
S LPosted Jun 6, 2015, 5:36 PM
This is great, thank you for the content!
Prakash TripathiPosted Jun 6, 2015, 2:27 AM
You are welcome.
Santhakumar MunuswamyPosted Jun 6, 2015, 2:06 AM
Thanks for nice article