We could do the operator[] extension. Are we sure we want to? The rput/rget to the gp<T> would only enjoy hw acceleration for trivially serializable T, thus dynamic length containers are out (this motivates Brian's use of std::array above). And the big question: what value is it to have a global_ptr to a scalar? We were thinking for metadata bootstrapping, but this seems like extra trips on the wire. In the gp case you rpc over to get the address, rpc that back, then rget from the gp address after the peer has signalled you its time to do so (possibly a barrier). Without gp, the user rpc's over, waits on future, rpc's back contents as result. Sooo much better.
The inheritance seems innocuous, except I was thinking dist_object has pointer semantics and is cheap to copy. The reason is dist_id<T>::when_local()
returns a future<dist_object<T>>
which can't be the original dist_object, obviously, and I don't want it to be future<dist_object<T>&>
(or *) since the original dist_object
may have died and only the in-filght rpc's are keeping it alive thanks to a distributed consensus algorithm (like garbage collection).
The fix: dist_array
should probably hold a dist_object internally as a field and abandon the pointer semantics.
Here is the current strawman proposal from the AHM:
Key features:
pointer_to
that avoids the future-construction overhead for the common case of cache hitglobal_ptr<T>
global_ptr<T>
for cache hit and nullptr on cache miss