gpt4 book ai didi

linux - mlock() 如何与休眠一起工作?

转载 作者:太空狗 更新时间:2023-10-29 11:50:12 28 4
gpt4 key购买 nike

引用 Linux 程序员手册 (man 2 mlock):

mlock(), mlock2(), and mlockall() lock part or all of the calling process's virtual address space into RAM, preventing that memory from being paged to the swap area.

这在休眠方面如何运作?使用 mlock() 的进程是否可以休眠?从休眠中恢复后的语义是什么?

最佳答案

这取决于您的系统。mlock 的 Linux 手册 says :

Be aware that the suspend mode on laptops and some desktop computers will save a copy of the system's RAM to disk, regardless of memory locks.

一些工具确实受mlock影响:

1- I hibernate the laptop with Armory opened.
2- I back from hibernate.
3- Armory doesnt syncronize. (To syncronize again I need to restart Armory).

关于linux - mlock() 如何与休眠一起工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41238436/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com