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
I understand why it is necessary in a parallel context, but it's also happening with unsafe_signal, slowing drastically the call to this function for no benefits.
The text was updated successfully, but these errors were encountered:
Slot copying does have a purpose even in single threaded use. It allows for slots to modify the parent signal such as removing itself from the signal as part of slot emission. Without copying this could run into iterator invalidation issues. Copying has other potential use cases in single threaded use as well.
Preferably slot copying could be opt-in with the use of a template policy. This would allow for the user to opt for high performance or opt into supporting these additional use cases at the expense of performance.
Ah, I missed that indeed. But as you said, it would be preferable to give the possibility for the user to disable this behavior because it is not always needed and the performance impact is huge.
allows for slots to modify the parent signal such as removing itself from the signal as part of slot emission
Since the only way for a slot to remove itself is to use connection.disconnect() and because connection is non-copyable, the connection has to be owned by something other than the slot.
This could result in poor encapsulation; you suddenly need a third entity in addition to the signal and slot.
Hello,
I noticed you are copying the slots when emit is called :
I understand why it is necessary in a parallel context, but it's also happening with unsafe_signal, slowing drastically the call to this function for no benefits.
The text was updated successfully, but these errors were encountered: