State for Concurrency within an actor

What is happening with State in the case of AsyncActor or threaded Actor. Are there any semaphores for state data access or its up to the user to ensure that multiple state updates are consistent between threads?

@blublinsky that’s a great question.

  • AsyncActor is running in a single thread so it’s thread safe, unless you created your own thread in the Actor code.
  • For threaded actor, the threads are C++ threads each trying to run things in the same Python interpreter. Even though there is GIL ensuring that Python interpreter is only running for one thread at a time, there is no guarantee about thread safety. Users should just treat threaded actors as not thread safe at all.

Let me know if you have more questions.