gpt4 book ai didi

c - mlockall 和共享库

转载 作者:太空宇宙 更新时间:2023-11-04 11:52:35 26 4
gpt4 key购买 nike

我对 mlockall 手册中出现的以下句子感到有点困惑。

mlockall() locks all pages mapped into the address space of the calling process. This includes the pages of the code, data and stack segment, as well as shared libraries, user space kernel data, shared memory, and memory-mapped files.

这是否意味着 mlockall(MCL_CURRENT | MCL_FUTURE) 将提前读取共享库的所有页面,并在调用该函数时将它们锁定到内存中?或者当流程实际需要这些页面时?

最佳答案

没有。就在进程需要页面的时候。 mlockall 所做的唯一一件事就是阻止页面加载到交换空间(交换)。

关于c - mlockall 和共享库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55599464/

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