class PDF::Reader::SynchronizedCache
interchangeable thread-safe cache implementations:
same time, we don’t want to throw away thread safety We have two
only save CPU cycles but also greatly reduce memory requirements But at the
from caching are made In some cases, caching and reusing results can not
Throughout the pdf-reader codebase, repeated calculations which can benefit
def [](key)
def [](key) @mutex.synchronize { @cache[key] } end
def []=(key,value)
def []=(key,value) @mutex.synchronize { @cache[key] = value } end
def initialize
def initialize @cache = {} @mutex = Mutex.new end