detection sys.: correction and alternative
ziyuan1135 opened this issue · comments
ziyuan1135 commented
correction:
- atomic_compare_exchange_strong(): cppreference與gcc的定義不一樣,須注意與修正。
e.g. insert_watchpoint func. and find_watchpoint func. in src/core.c
alternative:
-
check_access func. 使用mutex,解決同時兩個processes都對同一個記憶體進行操作,且該記憶體位址並未註冊在watchpoints之case
problem: lock會導致執行效率差
trade offs: 照原本的,不要使用mutex,若發生上述case,ignore -
watchpoints(array)位址存放方式: 使用slot與mod PAGE_SIZE(即offset)達到direct access,不須sequential search,即時間為big O(1)
problem: 若collison高,則效果不好
trade offs:照原本的,用sequential search即可
Chih-En Lin commented
- atomic_compare_exchange_strong(): cppreference與gcc的定義不一樣,須注意與修正。
Actually, the C11 is the same as the GCC builtin __atomic function. It is different from compare and swap logic.
My fault.
Sorry.