When defining a task with
LocalSubmit, a new subkernel is created. When you remove the task after the task is done, the task is removed but the subkernel remains open.
CloseKernals doesn't do anything, and
$KernelCount also returns
0. The only way I could terminate the subkernal is by killing the process of that subkernel in OS process manager (e.g., Task Manager on Windows and htop in Linux.)
How can I neatly terminate the subkernel within Mathematica, without having to find its PID and force-kill it on OS process manager?