1 | initial version |
You can find the PID of the working process by typing os.getpid()
in the worksheet. So to do what you want now, try the following:
os.getpid()
and note the PID.factor(2^997-1)
) going in the first worksheet. import signal; os.kill(that pid above, signal.SIGSTOP)
. The first worksheet will appear to be running, but will not use any CPU resources, as you can confirm with top on the server. os.kill(that pid above, signal.SIGCONT)
. You will see in top that the Python process associated with the first worksheet is back and burning resources. The point of the above exercise is that it illustrates that a pause feature could fully work. To really do this right, one would need to add something to the Sage Notebook itself, e.g., modify the sagenb spkg. This would involve some GUI design choices, etc.