大隻雞慢啼

大隻雞慢啼

我們是小國小民,但是我們是好國好民。 - 鄭南榕

27 Aug 2018

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

Categories