Re:The Linux kernel can spawn processes on its own
by saagarjha on Saturday June 11, 2022 @03:38PM
(#31707546)
This is convenient but having the kernel block on userspace doing something is typically bad design :(
[ Parent
| on HN ]
Re:The Linux kernel can spawn processes on its own
by throwawaylinux on Saturday June 11, 2022 @09:08PM
(#31710234)
It really isn't. "The" kernel doesn't block, a context blocks and typically that context is associated with a user process (directly or indirectly).
sleep(3) the kernel blocks for a time specified by userspace. futex(2) can cause the kernel to block until usespace wakes it. Similar wait(2). Also read(2) from a pipe or localhost socket.
So whether or not it is a bad design depends highly on what gets blocked, in what situations, and what can be done to recover the situation if things misbehave.