You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "Rahul.Singh5@morganstanley.com" <Ra...@morganstanley.com> on 2021/07/13 11:15:31 UTC

QPIC CPP threading model

Hello,
I am using qpid-cpp-1.39.0 and want to create multiple topics and handle incoming data in the most efficient way. What I have understood is that the qpid::messaging::Connection, Session and Receiver are all created in the application thread. When we try to fetch data from the Receiver, this is also processed in the application thread. But under the hood, it sounds like the Session might be communicating with the broker in a different thread and buffering up the incoming data for appropriate receivers to fetch them. I am inferring this after reading the in line comments for Receiver::fetch() method which states that "this method will check with the server that there is no message for the subscription this receiver is serving before returning false."

Is there a way we can get the thread Id or any Callback from it so that we can determine the thread id. Also is it correct to assume there is only 1 such thread per Session which is getting data from the other end?

Best Regards,
Rahul

________________________________
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent required and/or permitted under applicable law, to monitor electronic communications, including telephone calls with Morgan Stanley personnel. This message is subject to the Morgan Stanley General Disclaimers available at the following link: http://www.morganstanley.com/disclaimers.  If you cannot access the links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you acknowledge that you have read, understand and consent, (where applicable), to the foregoing and the Morgan Stanley General Disclaimers.

You may have certain rights regarding the information that Morgan Stanley collects about you. Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

Re: QPIC CPP threading model

Posted by Gordon Sim <gs...@redhat.com>.
On Tue, Jul 13, 2021 at 1:10 PM Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
> I need it to ensure I can run it on a specific CPU core.

Ok, running pstack against the process should show you the thread id for that.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


RE: QPIC CPP threading model

Posted by "Rahul.Singh5@morganstanley.com" <Ra...@morganstanley.com>.
Hello,

>>>>There is no callback. You could get the thread id from pstack output.
>>>>Why do you need it? (If you prefer a callback style of API, look at the QPid proton c++ library).

I need it to ensure I can run it on a specific CPU core.

Best Regards,
Rahul
-----Original Message-----
From: Gordon Sim <gs...@redhat.com> 
Sent: 13 July 2021 12:30
To: users@qpid.apache.org
Subject: Re: QPIC CPP threading model

On Tue, Jul 13, 2021 at 12:23 PM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> I am using qpid-cpp-1.39.0 and want to create multiple topics and handle incoming data in the most efficient way. What I have understood is that the qpid::messaging::Connection, Session and Receiver are all created in the application thread. When we try to fetch data from the Receiver, this is also processed in the application thread. But under the hood, it sounds like the Session might be communicating with the broker in a different thread and buffering up the incoming data for appropriate receivers to fetch them. I am inferring this after reading the in line comments for Receiver::fetch() method which states that "this method will check with the server that there is no message for the subscription this receiver is serving before returning false."

Correct. There is an IO thread that does all the sending and receiving of data.

> Is there a way we can get the thread Id or any Callback from it so that we can determine the thread id.

There is no callback. You could get the thread id from pstack output.
Why do you need it? (If you prefer a callback style of API, look at the QPid proton c++ library).

> Also is it correct to assume there is only 1 such thread per Session which is getting data from the other end?

There is one IO thread per connection.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org


--------------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.

You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: QPIC CPP threading model

Posted by Gordon Sim <gs...@redhat.com>.
On Tue, Jul 13, 2021 at 12:23 PM Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
> I am using qpid-cpp-1.39.0 and want to create multiple topics and handle incoming data in the most efficient way. What I have understood is that the qpid::messaging::Connection, Session and Receiver are all created in the application thread. When we try to fetch data from the Receiver, this is also processed in the application thread. But under the hood, it sounds like the Session might be communicating with the broker in a different thread and buffering up the incoming data for appropriate receivers to fetch them. I am inferring this after reading the in line comments for Receiver::fetch() method which states that "this method will check with the server that there is no message for the subscription this receiver is serving before returning false."

Correct. There is an IO thread that does all the sending and receiving of data.

> Is there a way we can get the thread Id or any Callback from it so that we can determine the thread id.

There is no callback. You could get the thread id from pstack output.
Why do you need it? (If you prefer a callback style of API, look at
the QPid proton c++ library).

> Also is it correct to assume there is only 1 such thread per Session which is getting data from the other end?

There is one IO thread per connection.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org