17176, "mppf", "sync variables and owned/shared", "2021-02-17T13:13:42Z"
says
Sync and single are supported for all Chapel primitive types ( Primitive Types) except complex. They are also supported for enumerated types ( Enumerated Types) and variables of class type ( Class Types). For sync variables of class type, the full/empty state applies to the reference to the class object, not to its member fields.
After this was written, we developed the idea that "class types" includes owned
and shared
. Do we intend for these to be the element type in sync
or shared
?
Meanwhile, there are confusing error messages when using sync owned
and sync shared
:
class C {
var x: int;
}
proc main() {
var x$: sync owned C? = new owned C(1); // error 1
writeln(x$.readFE());
var y$: sync shared C? = new shared C(1); // error 2
writeln(y$.readFE());
}
So the next steps are:
- decide if we want to support things like
sync owned C?
orsingle owned C?
. For that matter, should we supportsync borrowed C?
or just things likesync unmanaged C?
? - update the language specification to clarify
- update the implementation to give a better error message for any unsupported cases -- note that
isClassType
in the below is includingowned
andshared
- https://github.com/chapel-lang/chapel/blob/fc00057e01d274d9cf6f63aec9db95f299feea5b/modules/internal/ChapelSyncvar.chpl#L71-L80