假設,  你走高速公路要從基隆 到屏東 , 經過的每個縣都有收費站 , 你每站收費花很多時間 !!

 

hedgezzz 發表在 痞客邦 留言(0) 人氣()

offsetof 傳回一個變數在一個結構的 offset , 這個在你需要轉換指標時有用,

我在 intrusive linked list 也用到這個 function :

hedgezzz 發表在 痞客邦 留言(0) 人氣()

首先,必須介紹超級好站 : http://preshing.com/

還有這個:http://bartoszmilewski.com/2008/12/01/c-atomics-and-memory-ordering/

hedgezzz 發表在 痞客邦 留言(0) 人氣()

enqueue_pos_.compare_exchange_weak(pos, pos + 1, std::memory_order_relaxed)

memory_order_relaxed 是 c++11 的語法,以後再解釋, compare_exchange_weak 是 CAS(compare and swap) ,

hedgezzz 發表在 痞客邦 留言(0) 人氣()

網路上找到很好用的指標程式如下 :

template<class T>

hedgezzz 發表在 痞客邦 留言(0) 人氣()

想把程式備份....不太會用 痞客邦~~~~

ㄚ哉!!

hedgezzz 發表在 痞客邦 留言(0) 人氣()