Huawei-CPLLab / Theater

Actor model framework for Swift
Apache License 2.0
5 stars 1 forks source link

ShareDispatcher may cause deadlock if use selectActor API #3

Closed wanghc78 closed 8 years ago

wanghc78 commented 8 years ago

If we use ShareDispatcher and set maxqueue to 1, and let one actor to call selectActor function, the code pattern will be like q.async { ...; q.sync{} }. This is because all the actor will use the same queue.

Even if maxqueue > 1, if two actors uses the same queue, and one actor call selectActor to the other actor, the bug is still there.

If we still want to support one queue or share queue for different actors, we need to fix it by separating messaging processing queue and system activity (create/add/remove/query actors) processing queue.