cppwamp icon indicating copy to clipboard operation
cppwamp copied to clipboard

Thread-safe Session

Open ecorm opened this issue 10 years ago • 1 comments

Consider making Session objects more thread safe. This might entail that internal::WampMessage objects can no longer be reused in internal::Client, but must be constructed every time a message needs to be sent.

ecorm avatar Nov 04 '15 20:11 ecorm

Now that serializer/deserializer instances are reused within the same Session, making its existing operations reentrant is impossible without posting everything to Session's strand.

A set thread-safe methods (or overloads) will be added to Session which post everything to Session's strand. That way, single-threaded apps can continue using the existing API without the post penalty.

ecorm avatar Aug 03 '22 01:08 ecorm

Completed in 29153f69d57a975e872b430c35e5fb5bb441aa03

Session now has overloads taking the ThreadSafe tag which will perform the operation in a thread-safe manner when invoked from concurrent threads,

ecorm avatar Aug 13 '22 23:08 ecorm