1. Interval 開始前後的 Print 要各放在哪裡?
A. Tick
Processing thread >> reporter thread
periodically trigger the processing threads to publish their current tallies to the reporter thread
Send to all processing threads
special messages that can be configured to be automatically sent to all processing threads when either a certain amount of time has passed or a certain number of packets have been read.
Seen by a thread even if it inactive and no longer publishing results
will be seen by a thread even if it has not been assigned any packets from the hasher
2. 由於做平行化運算來加快速度,這邊會用多個Thread來進行,換句話說這邊我們可以用多個表格來進行Key Update以加快速度或者共用同一張額外的表格
但這各會產生一些問題
例如說,
四張小表格的話
最大可以多大,才可以待在Cache內? 避免L1/L2/L3(40MB可用) cache填滿後,外溢到Memory上,這樣速度就會變得很慢,要上百個clock cycle
有沒有辦法設定把表格放在L1/L2/L3快取的某個地方?
應用CacheLine size一次讀多/大一點回來以加快速度 /Cache Hit rate。(應用記憶的的空間性)
一張大表格的話
需要寫鎖,以免同時Update在表格的同一個格子上
Update進度到bitbucket上!