thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BCG <>
Subject Re: How to make a Thrift client for multiple threads?
Date Tue, 07 Jun 2016 15:57:46 GMT

On 06/07/2016 10:45 AM, Tuan Le Dinh wrote:
> Dear Matt Chambers, by mentioning "to use ThreadLocal connections", did you
> mean use it for TTransport or TProtocol or both?
Both TTransport and TProtocol are stateful objects that are not thread 
safe.  You should not be sharing them across client instances.  You must 
create new ones on each Thread, or use some method like ThreadLocal or 
pooling as others have suggested.

View raw message