異步服務器設計框架 AMPS

fmms 12年前發布 | 17K 次閱讀 異步服務器 網絡工具包

AMPS一個中間件,它提供了一個框架,用于構建任何一個事件驅動的,異步處理的應用。與傳統的基于線程的實現,AMPS允許單線程的方法,執行高并發應用程序。

AMPS is a middleware that provides a framework to write any software application as an event driven, asynchronous process . Unlike conventional thread based implementations, AMPS allows highly concurrent applications to run as a single thread of execution. 

AMPS實現要求,應用被設計成有限狀態機的模型,狀態的改變是基于事件的,每個狀態的改變都要求有事件處理程序一旦這樣的設想,實現能提供多重好處。

AMPS implementations require that the application be modelled as a FSM (Finite State Machine) that changes state based on ‘events’. ‘Event handlers’ are written for each state change. Once envisioned in this way, implementations provide multiple benefits. 

本編程模型的好處有:

  • 所有的執行都是不需要鎖的。沒有鎖,沒有互斥,不需要請求信號。
  • 所有事件處理程序都是確定的。
  • 自然支持對稱多處理,非對稱多處理和多核心系統。
  • 程序是云就緒的.
  • 沒有線程間上下文切換或者等待鎖的系統開銷。
  • 代碼是在線程所產生的耦合效應應用的深入細微的錯誤自由。
  • 代碼避免了基于線程的應用由于深度耦合而產生的bug.

Some of the benefits of this programming model are:

  • All execution is lock free. No locks, no mutexes, no semaphores required ever.
  • All event handlers are deterministic
  • Natural support for Symmetric multi-processing, Asymmetric multi processing and multi-core systems.
  • Applications are cloud ready
  • No system overhead in context switching between threads or waiting for locks.
  • Code is free of subtle bugs arising out of deep coupling effects in thread based applications.
Products developed on AMPS(基于AMPS開發的產品)

項目主頁:http://www.baiduhome.net/lib/view/home/1326808113702

 本文由用戶 fmms 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!