On 19/04/2019 11:02 am, Rabih M wrote:
We are only using proton objects in the handler, however, at destruction
time, there is a race condition on the reference counter between the proton
objects from the main thread that are being destroyed, and the proton
objects held by the proton thread.

Can you elaborate a little on this? Access to (or destruction of) objects from distinct connection should not need to be coordinated, though objects for the same connection clearly have to be.

Is the issue you are seeing related to some global state (e.g. sasl destruction)?

What calls are being made that are in a race? Is this plain C or c++ with implicit calls being made by destructors?

The reference counter not being atomic is very error prone for users.
How about transforming the int to an atomic int (already provided in C11
standard: https://en.cppreference.com/w/c/language/atomic)?

My initial thought is that just making the counter atomic would not be sufficient for general races, so it would be important to understand what specific uses cases this was designed to protect.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to