I understand the basic concept of stack and heap but great if any1 can solve following confusions:
-
Is there a single stack for entire application process or for each thread starting in a project a new stack is created?
-
Is there a single Heap for entire application process or for each thread starting in a project a new stack is created?
-
If Stack are created for each thread, then how process manage sequential flow of threads (and hence stacks)
There is a separate stack for every thread. This is true not only for CLR, and not only for Windows, but pretty much for every OS or platform out there.
There is single heap for every Application Domain. A single process may run several app domains at once. A single app domain may run several threads.
To be more precise, there are usually two heaps per domain: one regular and one for really large objects (like, say, a 64K array).
I don’t understand what you mean by “sequential flow of threads”.