[undertow-dev] Cache object that is not thread safe

Stuart Douglas sdouglas at redhat.com
Thu Apr 5 07:19:42 EDT 2018


If you want one per thread just use ThreadLocal.

Stuart

On Thu, 5 Apr. 2018, 7:42 pm Steve Hu, <stevehu at gmail.com> wrote:

> I need to share the same instance of a "Util" object to reuse it in all
> the handleRequest calls. Where is the best place to store the Util object
> instance? The Util class is not thread safe, so I should have one
> instance for each client thread.
>
> Thanks,
>
> Steve
>
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180405/8a75671a/attachment.html 


More information about the undertow-dev mailing list