semian icon indicating copy to clipboard operation
semian copied to clipboard

Thread Safety

Open tenderworks opened this issue 1 year ago • 0 comments

Hi,

I've noticed Semian has a few globals that aren't thread safe, or at least they're shared among threads. For example this consumers instance variable, the LRU cache, and this subscribers instance variable are all globals. I don't think they should be shared among threads, and if they are, I think they should be using a concurrent hash map.

I don't know all of the possible usages for this library, so I'm not sure the best way to fix it, but I don't think it's correct as it stands.

Thanks!

tenderworks avatar Nov 21 '24 19:11 tenderworks