109: (animated-1)
[personal profile] 109
вот, наткнулся на изделие мартина фаулера: lmax.

интересная и нетривиальная часть, как обычно, упомянута одним предложением: Should the master node go down, it's lack of heartbeat will be noticed, another node becomes master, starts processing input events, and starts its replicator.

вопросы, как обычно - кем will be noticed? что гарантирует единственность нового мастера? чем гарантируется, что старый мастер не очухается - или, если очухается, поймёт, что он уже не мастер?

в любом случае, интересное чтиво, например:

10: While the LMAX team shares much of the current interest in functional programming, they believe that the OO approach provides a better approach for this kind of problem. They've noticed that as they work to write faster code, they move away from a functional style towards OO style. Partly this because of the copying of data that functional styles require to maintain immutability. But it's also because objects provide a better model of a complex domain with a richer choice of data structures.

а, и ещё одного я не понял. почему фаулер считает, что lock приводит к context switching и cache invalidation? To deal with the write contention a queue often uses locks. But if a lock is used, that can cause a context switch to the kernel. When this happens the processor involved is likely to lose the data in its caches.

(no subject)

Date: 2013-05-24 07:39 pm (UTC)
From: [identity profile] 109.livejournal.com
это не просто, потому что надо выбрать мастера так, чтобы он был один, чтобы все согласились, кто новый мастер, и чтобы старый мастер понял, что он уже не мастер. поэтому наивное "Мастер очевидно регулярно посылает сообщения и том, что живой. Как только одно из них не доходит, инициируются выборы нового мастера" работать не будет.

Profile

109: (Default)
109

March 2019

S M T W T F S
     12
3456789
101112131415 16
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags