Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.

Commit 1de1b69

Browse files
committed
some README updates for TS::Cache
1 parent c0d7884 commit 1de1b69

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,22 @@ sh = ThreadSafe::Hash.new # supports standard Hash.new forms
2828
```
2929

3030
`ThreadSafe::Cache` also exists, as a hash-like object, and should have
31-
much better performance characteristics under concurrency than
31+
much better performance characteristics esp. under high concurrency than
3232
`ThreadSafe::Hash`. However, `ThreadSafe::Cache` is not strictly semantically
33-
equivalent to ruby Hash -- for instance, it does not neccesarily ordered by
34-
insertion time as Hash is. For most uses it should do fine though, and we
35-
recommend you consider `ThreadSafe::Cache` instead of `ThreadSafe::Hash` for your
36-
concurrency-safe hash needs.
33+
equivalent to a ruby `Hash` -- for instance, it does not necessarily retain
34+
ordering by insertion time as `Hash` does. For most uses it should do fine
35+
though, and we recommend you consider `ThreadSafe::Cache` instead of
36+
`ThreadSafe::Hash` for your concurrency-safe hash needs. It understands some
37+
options when created (depending on your ruby platform) that control some of the
38+
internals - when unsure just leave them out:
3739

3840

41+
```ruby
42+
require 'thread_safe'
43+
44+
cache = ThreadSafe::Cache.new
45+
```
46+
3947
## Contributing
4048

4149
1. Fork it

0 commit comments

Comments
 (0)