Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a user thread directly enter kernel w/o a kernel thread being called?

Can a user thread directly enter kernel w/o a kernel thread being called ? I mean, a user space enter kernel via an exception, w/o calling any kernel thread, but run in kernel code. Thanks !

like image 384
Yifan Zhang Avatar asked Jun 03 '26 21:06

Yifan Zhang


1 Answers

Yes, they can. User threads enter the kernel all the time for system calls, interrupts and exceptions. While the kernel is handling one of these it is running in kernel mode in the context of the user thread (and uses that thread's kernel stack).

In fact, a "kernel thread" is defined as a scheduled task that never exits the kernel.

like image 140
gby Avatar answered Jun 06 '26 15:06

gby



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!