[ 
https://issues.apache.org/jira/browse/THRIFT-2218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13821982#comment-13821982
 ] 

Alex Levenson commented on THRIFT-2218:
---------------------------------------

You had to instantiate them because they are not thread safe, and they take 
constructor args (like what protocol to use). We could make static methods that 
take all those arguments, not sure how useful that would be.

> Make java TSerializer and TDeserializer thread safe
> ---------------------------------------------------
>
>                 Key: THRIFT-2218
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2218
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Library
>            Reporter: Alex Levenson
>            Assignee: Jake Farrell
>         Attachments: TSerDe-thread-safe.diff
>
>
> They currently are not thread safe, though it seems that many people assume 
> incorrectly that they are. 
> This patch puts the shared mutable state used by TSerializer / TDeserializer 
> in a ThreadLocal object so that it is safe to share instances of TSerializer 
> / TDeserializer across threads.
> I've attached the patch, and you can view it in github here as well:
> https://github.com/isnotinvain/thrift/compare/TSerDe-thread-safe



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to