上世纪末 C10K 问题被提出来后, 各种程序设计模式被提出来解决这个问题. Reactor Pattern 是其中一个. Reactor Pattern 由 ... 在其论文 ... 中提出, 它以同步的方式侦听多个事件源已经处理这些事件源的方式. Reactor Pattern 包含如下几个组件: • Handles - 这是同步侦听器所侦听的事件源集合, 对应的可能是文件描述符, 定时器, 同步对象等 • Synchronous Event Demultiplexer - 同步侦听器, 会阻塞在所有的 Handles 上, 只要有一个 Handle 可以被无阻塞的操作, 就会返回. 典型的如 Linux/Win32 平台的 select 系统调用. • Initiation Dispatcher • Event Handler 使用 Reactor Pattern 的网络库 • Interview • ACE • 陈硕的 Muduo 与事件驱动 (Event Driven) 的区别 可能我们听得比较多的是事件驱动模型而不是 Reactor 模式, 事件驱动模型实际上是很笼统的定义, 实现事件驱动的方式可以有很多, Reactor 模式以及后面要介绍的 Proactor 是实现事件驱动的两种主要方式. 参考 https://stackoverflow.com/questions/9138294/what-is-the-difference-between-event-driven-model-and-reactor-pattern
author | cifer |
---|---|
permlink | reactor-pattern |
category | programming |
json_metadata | {"app":"peakd/2020.11.1","format":"markdown","tags":["programming","cn-programming"],"links":["https://stackoverflow.com/questions/9138294/what-is-the-difference-between-event-driven-model-and-reactor-pattern"]} |
created | 2020-11-16 11:06:15 |
last_update | 2020-11-16 11:06:15 |
depth | 0 |
children | 0 |
last_payout | 2020-11-23 11:06:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 707 |
author_reputation | 8,256,283,569,876 |
root_title | "Reactor Pattern 介绍" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 100,553,620 |
net_rshares | 42,067,986,178 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
mrstaf | 0 | 1,916,392,978 | 50% | ||
apasia.tech | 0 | 9,534,138,905 | 100% | ||
steembet.asia | 0 | 666,296,583 | 100% | ||
kimchi-king | 0 | 1,825,984,424 | 50% | ||
cryptoninja.guru | 0 | 959,418,114 | 100% | ||
bitsharesorg | 0 | 27,165,755,174 | 100% |