I l @ ve RuBoard |
A concurrency architecture is a binding between:
A networked application's concurrency architecture is one of several factors [1] that most impact its performance by affecting context switching, synchronization, scheduling, and data movement costs. There are two canonical types of concurrency architectures: task-based and message-based [SS93]. The primary trade-offs in this dimension involve simplicity of programming versus performance.
Task-based concurrency architectures structure multiple CPUs according to units of service functionality in an application. In this architecture, tasks are active and messages processed by the tasks are passive, as shown in Figure 5.7 (1). Concurrency is achieved by executing service tasks in separate CPUs and passing data messages and control messages between the tasks/CPUs. Task-based concurrency architectures can be implemented using producer/consumer patterns, such as Pipes and Filters [BMR + 96] and Active Object [SSRB00], which we illustrate in [SH]. Figure 5.7. Task-Based vs. Message-Based Concurrency Architectures
Message-based concurrency architectures structure the CPUs according to the messages received from applications and network devices. In this architecture, messages are active and tasks are passive, as shown in Figure 5.7 (2). Concurrency is achieved by shepherding multiple messages on separate CPUs through a stack of service tasks simultaneously . Thread-per-request, thread-per-connection, and thread pool models can be used to implement message-based concurrency architectures. Chapter 9 illustrates the use of thread-per-connection, and thread pools are shown in [SH]. Logging service We structure the networked logging service threading designs in this book using message-based concurrency architectures, in particular thread-per-connection, which are often more efficient than task-based architectures [HP91, SS95]. Task-based architectures are often easier to program, however, since synchronization within a task or layer is often unnecessary since concurrency is serialized at the task access points, such as between layers in a prostocol stack. In contrast, message-based architectures can be harder to implement due to the need for more sophisticated concurrency control. |
I l @ ve RuBoard |