Junior — Middle
How many stacks can be in a single running process?
sobes.tech AI
Answer from AI
A single running process can have multiple stacks, one for each thread. In C# and .NET, each thread has its own stack for storing local variables, function parameters, and return addresses.
Thus, the number of stacks equals the number of threads in the process. If the process is single-threaded — one stack; if multi-threaded — as many stacks as threads.
The size of the stack for each thread is usually set when the thread is created and by default is a few megabytes (for example, 1 MB).