开发者

Boost mutexes and semaphores on disk or in memory?

I would like to know if Boost mutexes and semaphores store any infor开发者_StackOverflow中文版mation on the disk, or if there is an option to avoid that (e.g. storing the data in a memory block).

I care about this detail both for performance reasons, and also to avoid throwing my SSD away too soon...

Thank you.


They're purely in memory. The only way anything would end up on disk would be if that particular memory got written out to the paging file. If that does happen, however, it's not going to do any more to your SSD than anything else being written to the paging file.


Nope. Boost mutexes that require file storage use memory-mapped files. But anything in main memory might possibly paged out to disk, unless you do some operating-system dependent action to prevent it.

http://www.boost.org/doc/libs/1_37_0/doc/html/interprocess/synchronization_mechanisms.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜