JActor介紹-Introducing JActor

 

JActor介紹

原題目:Introducing JActor

Vertical scaling is today a major issue when writing server code. Threads and locks are the traditional approach to making full utilization of fat (multi-core) computers, but result is code that is difficult to maintain and which to often does not run much faster than single-threaded code. 

當編寫服務端代碼時候,垂直擴展仍然是一個重大的問題。線程和鎖是充分利用大計算機(多核)的傳統方式,但結果卻是代碼很難維護,並且經常並不比單線程代碼快多少。

Actors make good use of fat computers but tend to be slow as messages are passed between threads. Attempts to optimize actor-based programs results in actors with multiple concerns (loss of modularity) and lots of spaghetti code.

Actor模式能很好的使用大計算機,但當消息從線程間傳遞時比較慢。優化基於actor的設計,結果往往是多重關係的actor(失去了模塊化)和一大堆麪條一樣的代碼。

The approach used by JActor is to minimize the messages passed between threads by executing the messages sent to idle actors on the same thread used by the actor which sent the message. Message buffering is used when messages must be sent between threads, and two-way messaging is used for implicit flow control. The result is an approach that is easy to maintain and which, with a bit of care to the architecture, provides extremely high rates of throughput.

JActor使用的方式是,最小化線程間傳遞的消息。在執行消息傳遞時候使用和消息發送actor同一個線程的空閒actor。 消息緩存用於消息必須在線程間傳遞時候,雙向消息傳遞用於隱式流程控制。最終結果就是,只要注意一點架構,這是一個搭建容易維護的,非常高的速率的吞吐量系統的好方式。

On an intel i7, 250 million messages can be passed between actors in the same JVM per second–several orders of magnitude faster than comparable actor frameworks.

在intel i7 在一個jvm虛擬機中每秒可傳遞2.億條消息,要比同類actor框架快一個數量級。

A fully durable in-memory database was also developed as a proof of concept, which processes transactions at a rate of 1 million per second when using an SSD for the backing store. Again, this is orders of magnitude greater than comparable approaches. 

在使用SSD作爲後臺存儲的,全內存數據庫的原型系統中,它達到了每秒1百萬個事務。再次超越了同類實現。

All code is LGPL, so there are effectively no constraints on usage. 

所有的代碼都是基於LGPL授權,因此在使用上是高效的沒有什麼限制。

GitHub: https://github.com/laforge49/JActor

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章