Assume that a ray actor is defined as below
@ray.remote
class Buffer:
def __init__(self):
self.memory = np.zeros(10)
def modify_data(self, indices, values):
self.memory[indices] = values
def sample(self, size):
indices = np.random.randint(0, 10, size)
return self.memory[indices]
Is it thread-safe to have other actors call methods of Buffer
without any lock?