Closed whamtet closed 6 years ago
Thread safety is a property of an algorithm/workload and you haven't explained what your threads are going to do with the connection. Ultimately Spyglass connections are nothing more than Spymemcached connections and as far as I can tell Spymemcached was designed with concurrent access in mind.
Thread safety means the connection can be safely accessed by more than one thread, it is not a property of algorithm / workload.
@whamtet yes it is because what exactly your app does is incredibly important and that is specific to your algorithm/workload. Concurrency safety is not a universal property and one cannot claim that a library is universally safe or unsafe, even if it is as small as Spyglass, without knowing how exactly it is used.
@whamtet consider how you'd answer the question if "safely used" is not known (since it is not known to me or any other reader who's not on the same project as you are). If the answer is "it depends on what exactly safely and used mean here", it's an algorithm/workload/use case property.
Thanks for the great client!
Is
(c/text-connection endpoint)
threadsafe or should I create a separate client for each thread? We've been getting some strange timeout messages.