Open nmboavida opened 1 year ago
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Hi @nmboavida, we do have RWLocks for shared object references now(via mutable
flag on shared arg), but you are right we do not support this for owned objects and all owned object references are treated as mutable.
We are considering introducing owned object RWLocks as well in the future releases. If you can share the use case where you could leverage owned object RWLocks this perhaps can help us to decide on the priority
ObjectArg::ImmOrOwnedObject(ObjectRef)
only has the object ID and does not distinguish whether a SWO is borrowed as a immutable or mutable reference. By bundling immutable objects and SWO in a single enum type with anObjectRef
we are not passing the info about whether we're dealing withT
,&mut T
or&T
.This means that when
authority::handle_transaction_impl()
gets called and when we getowned_objects
viainput_objects.filter_owned_objects()
there is no way to distinguish if those owned objects areT
,&mut T
or&T
. Theseowned_objects
then get passed toset_transaction_lock()
asmutable_input_objects
even though some might beimmutable
, and therefore we are always acquiringMutex
, even though&T
only needsRwLock
.In effect this means we can't parallelize transactions that use immutable SWO references.
It would be great to know if is there any chance this gets changed any time soon, or am I missing something?