Is client-side of thrift-cpp thread-safe?
c++, multithreading, thrift
Solution
Thrift has doxygen docs, but they don't seem to get built. They're not terribly pretty. To generate a copy, run (in the thrift source directory) `doxygen -g Doxyfile`, change RECURSIVE to YES, then run `doxygen Doxyfile`.
In answer to your questions:
Which client? There are whole bunch of different thrift transports. In general, there isn't (AFAICT) any global state, so you can create different clients in different threads. If you're trying to use the same transport in multiple threads, you probably want manual locking unless you've read the code and confirmed that it's okay.
I haven't seen one. AFAICT there are just a bunch of transports that you can connect yourself. There's the TSocketPool, but that's a load-balancing tool, which isn't what I think you're looking for.
My advice: use the memory transport only and do your own networking. What Thrift does probably isn't what you want to do, and, even if it is, their documentation and packaging is pretty bad. (Or use protocol buffers instead of thrift -- they are IMO much better maintained these days. I think this even though I was a thrift contributor way back when.)
Problem
I have three quetions. - Is client-side of thrift-cpp thread-safe? - Do they have some kind of connection-pool on thrift? - Any good practice for using thrift-cpp-client. thanks!