Disruptor & LMAX Architecture
這篇文章是雜亂的筆記,尚待整理。
Disruptor 是一個 LMAX 提出的 lock-free concurrent ring buffer library,可以用於 inter-thread communication。官方 GitHub Wiki
log4j 2 的 asynchronous loggers 實作使用 disruptor。
Patricia Gee,其中一個作者,在自己的舊blog 上面有詳細的介紹。摘錄幾個重點
- Single thread is fast
- Lock-free, except BlockingWaitStrategy
- Ring buffer
- Cache line padding
- Memory barriers
關於 queue,Communication of ACM 有篇文章 討論 multi-core 的情境下要怎麼 scale up。
Notes
- Martin Fowler 介紹 LMAX 架構: https://martinfowler.com/articles/lmax.html
- Disruptor 第一作者,Martin Thompson 的公司: Real Logic 的 GitHub 有許多有趣的專案,記錄下來日後待查。
- agrona : 其中一個貢獻者是 Richard Warburton,他是 Java 8 Lambdas 的作者,這本書很清楚易懂。讓我感覺能把技術說的深入淺出,才是真正有實力的人。