
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Thread safe LRU Cache implementation in Ruby compatible with Java's Memory Model.
Add this line to your application's Gemfile:
gem 'threadsafe-lru'
And then execute:
$ bundle
Or install it yourself as:
$ gem install threadsafe-lru
# initialize cache with maximum size of 200
cache_size=200
fib_cache=ThreadSafeLru::LruCache.new 200
# fetch fibonacci of 42 from cache. only first execution will perform computation (evaluate block)
fib_200 =fib_cache.get(42) {|key| fib(key)}
# drop key 42 from the cache
fib_cache.drop(42)
# clear cache by dropping all cached values
fib_cache.clear()
There are two level of locking within the cache.
* Cache lock makes sure that cache structure can be accessed only by one thread at the time.
* Value lock makes sure that only one thread produces a value for given key at the time.
All other threads interested in obtaining the value for the key are waiting for the first thread to finish
ThreadSafeLru has been tested with MRI 1.9.3, Jruby 1.6.2, Jruby 1.7.0.preview1 and Jruby 1.7.0.preview2
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that threadsafe-lru demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.