thana
10/12/2020, 6:15 AMactor
is run within?gildor
10/12/2020, 6:29 AMthana
10/12/2020, 6:32 AMgildor
10/12/2020, 6:33 AMthana
10/12/2020, 6:38 AMactor
for stateful actors. one selling point of actors is, that you do not have to care about synchronization because its run within a single thread. now, if you spread execution between multiple threads you do have so synchonize access on mutable data. i think thats kinda ugly.
You are right, it's possible to execute it with a single threaded execution context. but i wonder why there are no warning signs about that fact...gildor
10/12/2020, 6:43 AMdo have so synchonize access on mutable dataNo, if actor itself holds this data, or only if it only who modifies it, you don;’t need any syncronization in this case
gildor
10/12/2020, 6:44 AMthana
10/12/2020, 6:49 AMgildor
10/12/2020, 8:50 AMjava’s memory model visibility guaranteesYes, but in suspend function you have all guarantees (every next line of suspend function invoked after of previous line with happens before guarantees, even if this call was also suspend)
gildor
10/12/2020, 8:51 AMSo if i set a value, then suspend and then read the valueIt doesn’t require any additional check
gildor
10/12/2020, 8:55 AMthana
10/12/2020, 9:05 AMthana
10/12/2020, 10:55 AM