Replies: 2 comments 11 replies
-
Use
What would be extremely useful to this project is for you to use the latest RC (https://www.nuget.org/packages/RabbitMQ.Client/7.0.0-rc.8), remove the locks from your code, and report back. After a quick review of the |
Beta Was this translation helpful? Give feedback.
-
For multi-frame operations (namely Bunny (the most popular Ruby client) does exactly this: it synchronizes socket writes because not doing so is not practical in the context of certain Web servers, but sharing channels between threads is not supported. Two levels of locking on the hot code path and the complexity of a concurrent continuation implementation (in Ruby, it can be much easier to reason about in C#) were not worth the effort. My point is that socket-level synchronization is not enough in practice with key operations mentioned above. |
Beta Was this translation helpful? Give feedback.
-
In previous versions, the doc states that a model/channel must be only accessed from one thread at a time.
In the v7 implementation, I see that the .NET Channel classes are used internally and there is an internal thread to actually process and send commands to server. My gut-feeling is that now it is safe for my code to call methods on a RabbitMQ model/channel object from different threads without locks in my code. On the other hand, the async API makes it impractical to do locks, where the lock will span over awaits which is a recipe for deadlock.
Just want to confirm whether my understanding is correct. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions