词条 | Reactor pattern |
释义 |
The reactor design pattern is an event handling pattern for handling service requests delivered concurrently to a service handler by one or more inputs. The service handler then demultiplexes the incoming requests and dispatches them synchronously to the associated request handlers.[1] Structure
PropertiesAll reactor systems are single-threaded by definition, but can exist in a multithreaded environment. BenefitsThe reactor pattern completely separates application-specific code from the reactor implementation, which means that application components can be divided into modular, reusable parts. LimitationsThe reactor pattern can be more difficult to debug[2] than a procedural pattern due to the inverted flow of control. Also, by only calling request handlers synchronously, the reactor pattern limits maximum concurrency, especially on symmetric multiprocessing hardware. The scalability of the reactor pattern is limited not only by calling request handlers synchronously, but also by the demultiplexer.[3] See also
References1. ^Schmidt, Douglas et al. Pattern-Oriented Software Architecture Volume 2: Patterns for Concurrent and Networked Objects. Volume 2. Wiley, 2000. 2. ^{{Citation | first = Douglas C. | last = Schmidt| title = An Object Behavioral Pattern for Demultiplexing and Dispatching Handles for Synchronous Events| url =http://www.dre.vanderbilt.edu/~schmidt/PDF/reactor-siemens.pdf}} 3. ^{{Citation | last = Kegel | first = Dan | title = The C10K problem | url=http://www.kegel.com/c10k.html#nb.select | accessdate = 2007-07-28}} External links
3 : Concurrent computing|Events (computing)|Software design patterns |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。