qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Stitcher <astitc...@apache.org>
Subject Re: qpid-proton C++ on_sendable race condition
Date Thu, 29 Jun 2017 18:28:10 GMT
Sorry not to get back to you earlier - I've been at a conference for
the past few days.

Comments inline.

On Tue, 2017-06-27 at 12:00 +0200, Daniel Pocock wrote:
> 
> reSIProcate has a class QpidProtonThread[1] for sending to a topic.
> 
> The class runs the container in a thread, the method
> QpidProtonThread::thread() is the code executed in the thread when it
> starts.
> 

I'm assuming this is an application method as I don't recognise that
name.

> Another thread is calling the sendMessage(..) method.  That method
> uses
> event_loop()->inject(...) to have the doSend(...) method called
> safely.
> This appears to work for a while.

Probably accidentally! The cross thread functionality was experimental
(and rather broken) in the current (0.17) release.
> 
> I notice that when the event loop calls my void_function0 class
> operator(), which calls doSend(...), it is not calling it in the
> container thread, it is being called in the thread that invoked
> sendMessage(...).  Is that expected behaviour?

That is the expected, but broken, behaviour - I said that released code
was experimental!

> 
> Eventually, the on_sendable() method is called.  I see it is being
> called in the container's thread.  That method also calls
> doSend(...).
> At this point, the other thread becomes stuck.

I expect it's a deadlock
.
> 
> I was thinking about simply removing the on_sendable()
> method.  However,
> given that I am using the inject method, should I not be having a
> problem like this at all?

If you can wait a couple of weeks the new C++ IO code should get merged
to master and the 0.28 release made.

This should fix the problem you are having.

If you continue having problems then, or you want help trying the new
code on the branch. Let me know

Andrew


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


Mime
View raw message