Shared
using Java annotation mechanism. The Shared variables are accessible across tasks, eg. one task can get access to the shared variable instance stored in another task. Shared variables have to be defined as part of enum variable and have to be registered using @RegisterStorage
annotation.get()
) or to modify variable located in the memory of another task (put()).get(}
and put()
perform one-sided communication. This means, that access to the memory of another task is performed only by task which executes get or put methods. The task which memory is contacted do not need to execute these methods.a
at task 3 to the variable c
at task 0.array[2]
at task 3 to the variable c
at task 0.a
available at the task 5. This operation is performed by the task 0.array[]
stored at the thask 2. The array[1]
element is updated.asyncPut()
and asyncGet()
can be used for asynchronous communication which means that user has no guarantee that value has been changed or transferred from remote task. The use of asynchronous communication may cause some problems, especially for non experienced users. PCJ provides additional methods to solve this problem.