Thanks for your tips. I have updated my code to wrap TransmittableThreadLocal <https://github.com/alibaba/transmittable-thread-local/blob/master/README-EN.md>, an enhanced version of InheritableThreadLocal, to solve threadpool problem.
On Sunday, July 30, 2017 at 3:11:59 AM UTC+8, Didier wrote: > > InheritableThreadLocal is not safe to use with ThreadPools. And a lot of > the Clojure parallel constructs rely on ThreadPools. > > I'd recommend you rely on dynamic Vars instead and use bound-fn when you > want child threads to inherit parent's bindings. > > If you knew this already, then I see no harm in using > InheritableThreadLocal, but just be sure you understand its risk. In most > cases, it is unsafe. > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.