You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Salmon will lock every call to a handler by default. This is great for thread safety, but absolutely garbage for performance. There is a nolocking decorator if you know your code is thread-safe.
I was wondering how current users of Salmon would feel if I reversed this situation and made Salmon assume handlers were thread-safe?
Given that web frameworks (e..g Django and Flask) expect users to write thread-safe code, I don't think this is a huge ask. For my own purposes, I already write thread-safe code and I'm always using nolocking.
If I made this change, that would mean I'd have to go through various bits of Salmon code and make sure they're thread-safe (e.g. Queue is definately not thread-safe).
What does everyone else think?
The text was updated successfully, but these errors were encountered:
Currently Salmon will lock every call to a handler by default. This is great for thread safety, but absolutely garbage for performance. There is a
nolocking
decorator if you know your code is thread-safe.I was wondering how current users of Salmon would feel if I reversed this situation and made Salmon assume handlers were thread-safe?
Given that web frameworks (e..g Django and Flask) expect users to write thread-safe code, I don't think this is a huge ask. For my own purposes, I already write thread-safe code and I'm always using
nolocking
.If I made this change, that would mean I'd have to go through various bits of Salmon code and make sure they're thread-safe (e.g. Queue is definately not thread-safe).
What does everyone else think?
The text was updated successfully, but these errors were encountered: