Each process has its own kernel stack, right?
<p>I saw some SO questions come with a conclusion: Each process has its own kernel stack. But how about this code?</p>

<pre><code>main()
{
    while(1)
        ;
}
</code></pre>

<p>Or how about this one?</p>

<pre><code>main()
{
}
</code></pre>

<p>Whether does this program also have a corresponding kernel stack?</p>

<p><strong>More:</strong>
For the 1st code above, I tested it like below. Press Ctrl+C to stop it, and see that system time is less than 1ms as below.</p>

<p>I think what I want to know is whether a user space program's execution path must go through kernel space? For my example code, I think the process itself does not go through kernel space when it executes, is this right?</p>

<pre><code>$ time ./a.out 
^C

real    0m24.953s
user    0m24.942s
sys     0m0.000s
</code></pre>