What is the difference between Evaluation ► Quit Kernel and Quit[]?
Both seem to quit the kernel (and clearing all definitions).
Answer
You cannot Quit kernel while evaluation is still running: the Quit[] command will be placed in the queue and executed only after finishing of evaluation of all the previous inputs. In contrast, Evaluation ► Quit Kernel will quit the kernel immediately even if it is still running.
UPDATE
As Kuba noticed in the comments, via "Preemptive" link it is possible to inject the Quit[] command into running kernel, for example via Button:
Button["test", Quit[]]
But even in this case Quit[] will be evaluated only when the running kernel reaches some point in its computation where such evaluation is possible: for example, if the running code is wrapped with PreemptProtect, the Quit[] command will be queued and will not be evaluated before evaluation of the PreemptProtected code block finishes.
In contrast, Evaluation ► Quit Kernel always quits the kernel immediately.
Comments
Post a Comment