TLS的實作分成4種model
1. General Dynamic Model可以處理所有狀況
2. Local Dynamic Model的限制在於 TLS variable需要declare在同個file scope
3. 忘惹自己查
4. 忘惹自己查
TLS會在以下三種狀況下allocation
1. program start
2. thread create
3. 如果thread_local declare在.so file, 當.so load好後只會create table (如下圖的dtv t4), 直到TLS variable被access的時後, 才會做allocation
http://docs.oracle.com/cd/E19683-01/817-3677/chapter8-1/index.html
ps. TLS varible的address是透過 thread pointer + module id + offset 算出的
ps. 每個thread有一個table
dtv: dynamic thread vector
TCB: thread control block

沒有留言:
張貼留言