On Tue, Mar 5, 2013 at 1:52 AM, Phil Harvey <[email protected]>wrote:
> I've been working with the proton-j engine recently and want to clarify the > threading model. > > The Proton web site [1] says Proton "is architected to be usable with any > threading model as well as with non threaded applications". > > Turning to the implementation, I've heard that the proton-j engine is > intended to be used by one thread at once. This sounds reasonable, but I > want to clarify what "one thread at once" really means in this context. > What this really means is that a bound transport/connection pair form a single data structure and if you want to access it concurrently from multiple threads you need to protect it with your own mutex. > > I believe we should say something like this in the proton-j documentation: > > "Proton engine classes are not synchronized. If multiple threads access a > Proton engine object concurrently, external synchronization must be used." > That sounds reasonable to me. You mind also want additional language defining a single engine instance as a bound transport/connection pair. Ditto for the Message package. > > Any improvements, objections etc? > > Out of interest, what is the threading model of Messenger? And how about > proton-c? > It's the same for proton-c and for Messenger. --Rafael
