memery icon indicating copy to clipboard operation
memery copied to clipboard

Thread safety?

Open Overload119 opened this issue 3 years ago • 1 comments

I was wondering if this is threadsafe. It seems https://github.com/yegor256/zache is and it mentions it in the README. Would be useful to know!

Overload119 avatar Nov 01 '21 20:11 Overload119

For thread-safety Zache has Mutex inside. It sometimes slows work down, but provides locks.

However, Memery has no Mutex inside, so it's thread-unsafe, if you worry about this.

AlexWayfer avatar Nov 01 '21 21:11 AlexWayfer

You should only memoize methods that always return same value for same set of arguments. If that is the case, you should not really worry about thread safety.

tycooon avatar Apr 06 '24 10:04 tycooon