Memory mapped - partially disk based algorithms

后端 未结 3 521
不思量自难忘°
不思量自难忘° 2021-02-03 12:46

Are there any good resources or books for spillable data structures, that is, say, a queue?

When storing large objects it could fill up all of memory, but if you can ke

3条回答
  •  猫巷女王i
    2021-02-03 13:40

    Do you mean finding efficient disk-based analogues to the fundamental RAM-based data structures (for example, linked lists, stacks, queues, priority queues, etc.)? If so, the answer below may or may not be helpful.


    I'm not entirely sure what you're trying to do. By queue, do you mean a FIFO (first in first out) queue or a priority queue?

    For dealing with FIFO queues and logging, perhaps you could look into ring buffers and log rotation.

    For dealing with caching data in RAM to minimize disk access, you may or may not be better off leaving that to the operating system. Unless you're developing a Windows application, you might be better off simply reading and writing to and from files the naive way, since the operating system should perform read and write caching well enough. However, as far as I can tell, Windows has horrible read/write caching (I may be wrong).

    Perhaps looking at the VFS subsystem in Linux and studying http://lxr.linux.no/#linux+v2.6.31/Documentation/filesystems/vfs.txt will help, since (I think) this is the part of Linux that handles caching.

    I'm not an expert in queues and caching, but I do know a few things about it. If you could provide more detail on what you are trying to do, maybe someone can help you hone in on the right solution.

提交回复
热议问题