Actors' Non-Blocking Send vs. CSP's Synchronous Rendezvous

The Actor Model employs asynchronous message passing, allowing a sender to continue processing immediately after sending a message without waiting for the receiver. In contrast, CSP channels often utilize synchronous communication (rendezvous), where the sender typically blocks until the receiver is ready to accept the message.

The top 3

  1. Actor Model's Throughput Edge vs. CSP's Synchronous Efficiency: The Actor Model leverages non-blocking, asynchronous message passing, where senders continue immediately after dispatching a message to a receiver's mailbox, potentially achieving higher overall system throughput. Conversely, CSP's synchronous rendezvous requires a sender to block until the receiver is ready to accept the message, which can limit concurrency by introducing waiting states but simplifies reasoning about message flow and ensures channels only hold one message at a time.
  2. Deadlock Handling: CSP's Local Clarity vs. Actors' Global Complexity: CSP's synchronous rendezvous can make deadlocks easier to reason about locally due to explicit and blocking communication. However, both Actor Model and CSP systems are susceptible to communication deadlocks, where processes endlessly wait for each other. While Actor systems offer resilience to individual failures, their asynchronous nature and potentially large mailboxes can lead to more complex global deadlock scenarios. Some Actor implementations, like Akka, address this by using mailboxes with unlimited capacity by default.
  3. Backpressure Management: Actors' Implicit Buffering vs. CSP's Explicit Control: Actors utilize mailboxes that implicitly buffer messages, allowing senders to continue without waiting, but requiring explicit mechanisms to prevent unbounded queue growth. CSP's synchronous rendezvous inherently provides backpressure: a sender blocks until the receiver is ready, ensuring flow control and limiting buffer sizes by design.

Sources

Open the full topic