Page 1 of 1

[NEWS] Objects Cache

Posted: Wed Aug 28, 2019 10:30 am
by Giovanni

I just added to OSLIB in trunk a new class "Objects Cache", it implements a cache of arbitrary objects or buffers that are read/written from/to an arbitrary media.

The class implements a LRU list with most recently used objects/buffers, an hash table is used for fast objects/buffers retrieval. Some features:
- Fully static.
- Synchronous or asynchronous read and write operations.
- Read ahead.
- Immediate or lazy write operations.
- Mutual exclusion implemented at object/buffer level (multiple threads can ask for the same object and are serialized if required).

The test suite is not complete but it APPEARS to work, the most immediate use case is to add it to the FatFS bindings in order to increase I/O performance. Ideally it will be used by a native FS able to leverage the advanced features like lazy writing which FatFS could not support as-is.