2015年3月18日 星期三

Kahn process networks (KPN)



  • Determinism
同一組輸入會產生同一組的輸出,
Processes can be modeled as sequential programs that do reads and writes to ports in any order or quantity as long as determinism property is preserved. As a consequence, KPN model is deterministic so that following factors entirely determine outputs of the system:
  • processes
  • the network
  • initial tokens
Hence, timing of the processes does not affect outputs of the system.


2015年3月17日 星期二

有限狀態機 FSM

有限狀態機是由一組狀態一個起始狀態、 輸入、將輸入與現在狀態轉換為下一個狀態的轉換函數所組成。

比方說:自動販賣機、電梯升降系統、紅綠燈系統...


一個特殊的方式:
Global asynchronous Local synchronous
全域是非同步的,但區域是一個獨立同步的FSM。(my comment: 整體看起來像一個大型FSM,只是每個小的程序其實是一個獨立的FSM。)


一個FSM的特性:
單位時間同步化。
輸入階段、處理階段、運算結果是同一個單位時間的回饋。

  • 設計理念:

   輸入的瞬間,輸出已經完成。
  • 前提:

  1. 計算+內部處理不需要時間(歷時超級快速所以可以省略)。
  2. event 之間不是同步,就是歷時相差極遠。







2015年3月15日 星期日

數據驅動 vs 控制驅動

Data-driven concurrency(數據驅動併發):

1.The system is modelled as a set of processes without any explicit specification of the ordering of executions. 不會定義排程的執行順序。

2.The execution order of processes (and, implicitly, the potential of parallelism) is fixed solely by data dependencies 排程的執行順序是依照數據的相關性。

Control-driven concurrency(控制驅動併發):

1.The execution order of processes is given explicitly in the system model. 
在系統中已經明確指定執行順序。

2.Explicit constructs are used to specify sequential execution and concurrency. 
明確的結構用於指定順序執行和並發性。