skynet的actor问题 #1859
cppbeliever
started this conversation in
General
skynet的actor问题
#1859
Replies: 1 comment 2 replies
-
每个actor就相当于一个单进程单线程的环境。 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
都说actor之间不共享内存,那么,请问,actor的mailbox是不是共享内存,是不是在多线程环境下运行时需要加锁?
比如:actor_B 和 actor_C 这两个线程同时向actor_A的mailbox发送异步消息,并且actor_A线程从mailbox取出消息进行处理。三个线程同时运行,请问,actor_A的mailbox是不是加锁?
我个人认为,肯定要加锁,只是对mailbox的操作粒度很小,加的是自选锁而已。
我对actor的理解是小白,求解惑。
Beta Was this translation helpful? Give feedback.
All reactions