You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by David Hinkle <hi...@cipafilter.com> on 2013/06/14 18:31:11 UTC

C++ Callback Objects

I'm interested in using thrift from different threads asynchronously.
Right now I've put together an architecture that involves using the
standard cpp compiler.  In this setup, all the threads that want data issue
send_'s.   Then they all issue recv_'s in the same order.   This allows me
to keep the latency down to a manageable level for my application.

I noticed the cob_style flag to the cpp compiler.   I did a compile and
reviewed the code and it seems to support some sort
of asynchronous callback driven model which is very interesting for my
application.

I'm curious if these calls are thread safe, if they can be mixed with send_
and recv_ calls.   Does anybody have any docs, or example code?   Also,
everything I've learned about thrift has come from reading the code.  Are
their any API docs in general?

Thankyou,

- David

-- 
*David Hinkle*

*Senior Software Developer*

*Phone:*  800.243.3729x3000

*Email:*  hinkle@cipafilter.com

*Hours:*  Mon-Fri   8:00AM-5:00PM (CT)

Re: C++ Callback Objects

Posted by Ben Craig <be...@ni.com>.
I'm not sure about the cob_style stuff, but the "regular" clients aren't 
thread safe.  If multiple threads are both trying to call send_xxx at the 
same time, then you can run into trouble.

As far as docs and example code, I'm basically in the same boat as you.  I 
learned by looking at the code.



From:   David Hinkle <hi...@cipafilter.com>
To:     user@thrift.apache.org, 
Date:   06/14/2013 11:31 AM
Subject:        C++ Callback Objects



I'm interested in using thrift from different threads asynchronously.
Right now I've put together an architecture that involves using the
standard cpp compiler.  In this setup, all the threads that want data 
issue
send_'s.   Then they all issue recv_'s in the same order.   This allows me
to keep the latency down to a manageable level for my application.

I noticed the cob_style flag to the cpp compiler.   I did a compile and
reviewed the code and it seems to support some sort
of asynchronous callback driven model which is very interesting for my
application.

I'm curious if these calls are thread safe, if they can be mixed with 
send_
and recv_ calls.   Does anybody have any docs, or example code?   Also,
everything I've learned about thrift has come from reading the code.  Are
their any API docs in general?

Thankyou,

- David

-- 
*David Hinkle*

*Senior Software Developer*

*Phone:*  800.243.3729x3000

*Email:*  hinkle@cipafilter.com

*Hours:*  Mon-Fri   8:00AM-5:00PM (CT)