cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep Tata <sandeep.t...@gmail.com>
Subject Re: Best way to use a Cassandra Client in a multi-threaded environment?
Date Thu, 16 Jul 2009 00:47:07 GMT
>From what I remember, in Java, the thrift client object is threadsafe
-- but if multiple threads use the same client, they will serialize on
it.
In my tests a client-per thread has worked fine for a small number of
threads . Depending on what your threads are doing and how many you
have, you may need pooling.


On Wed, Jul 15, 2009 at 5:41 PM, Ian Holsman<ian@holsman.net> wrote:
>
> On 16/07/2009, at 10:35 AM, Jonathan Ellis wrote:
>
>> IIRC thrift makes no effort to generate threadsafe code.
>>
>> which makes sense in an rpc-oriented protocol really.
>
> hmm.. not really. you can have a webserver calling a thrift backend quite
> easily, and then you would have 100+ threads all calling the same code.
>>
>> On Wed, Jul 15, 2009 at 7:25 PM, Joel Meyer<joel.meyer@gmail.com> wrote:
>>>
>>> Hello,
>>> Are there any recommendations on how to use Cassandra Clients in a
>>> multi-threaded front-end application (java)? Is the Client thread-safe or
>>> is
>>> it best to do a client per thread (or object pool of some sort)?
>>> Thanks,
>>> Joel
>
> --
> Ian Holsman
> Ian@Holsman.net
>
>
>
>

Mime
View raw message