Can I use the msleep() function to sleep for a specified amount of time in kernel space? If so, which header files do I need to include? #include <linux/time.h>
doesn't seem to be the right one. Is there perhaps a better function for this purpose?
Linux does indeed log out, but jupyter notebook calculations run further and Linux does not go to sleep unless they are done. If you wake the computer in the morning, you will find the finished calculations with all variables still in memory.
What Does the Linux sleep Command Do? The sleep command suspends the calling process of the next command for a specified amount of time. This property is useful when the following command's execution depends on the successful completion of a previous command.
An easier way to do things, and presumably the default way on all modern Linux operating systems, would be to simply leave /sys/power/mem_sleep set to deep and write freeze to /sys/power/state to Suspend-To-Idle, and to write mem to /sys/power/state to Suspend-To-RAM.
I needed to include <linux/delay.h>
to use msleep in kernel space.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With