package aches
Install
Dune Dependency
Authors
Maintainers
Sources
md5=c9c5400e7ae19100b945279835ff3e5c
sha512=7f37b721e2ca32e5e96fbf8df1bbd72c9060b6826bd95a21ea81af5fdd0c1961d3d7fb41210966aac7c277ec7f91fd32e3e284b583cb02121dc589646642f5c0
doc/aches.rache/Rache/index.html
Module Rache
Source
Rache
Rache is a library for resource caches.
More specifically, Rache provides modules implementing caches for resources. These caches are parametrised by cache-policies: replacement policy and maximum size. The caches also provide a clean-up mechanism to deal with resource tear-down.
Caches
TRANSFER
are caches in which resources can be put and from which resources can be taken. More precisely, caches where the ownership of the resources (the responsibility to clean them up) can be transferred into and out of the cache.
BORROW
are caches in which resources can be borrowed but never transferred. In other words, the cache retains ownership of all resources.
All caches of Rache have either the TRANSFER
interface (for caches with transfer of ownership) or the BORROW
interface (for caches with borrowing of resources). Their behaviour can be tweaked by the parameters below.
Cache policies
REPLACEMENT
is for defining the replacement policy of a cache. LRU
is for "Least Recently Used", meaning that when a supernumerary item is inserted in the cache, the least recently used item is removed to make room. FIFO
is for "First-In, First-Out" meaning that when a supernumerary item is inserted in the cache, the oldest inserted element is removed to make room.
Cache instantiating
Transfer(R)(H)
is a TRANSFER
indexed by H
and govern by the replacement policy R
.
Borrow(R)(H)
is a BORROW
indexed by H
and govern by the replacement policy R
.
EmptyTransferMap(H)
is a transfer-map module but it only supports the empty map: a map with zero elements.
SingletonTransferMap(H)
is a transfer-map module but it only supports singleton maps: maps with at most one element.
EmptyBorrowMap(H)
is a borrow-map module but it only supports the empty map: a map with zero elements.
SingletonBorrowMap(H)
is a borrow-map module but it only supports singleton maps: maps with at most one element.