作者查詢 / ManOfSteel

總覽項目: 發文 | 留言 | 暱稱
作者 ManOfSteel 在 PTT [ Linux ] 看板的留言(推文), 共10則
限定看板:Linux
首頁
上一頁
1
下一頁
尾頁
Fw: [問題] bool變數一寫多讀需要鎖嗎
[ Linux ]0 留言, 推噓總分: 0
作者: SFGEX - 發表於 2026/02/12 14:49(2天前)
1FManOfSteel: 我想請問一下,你是怎麼知道bool型別支援single write02/12 00:10
2FManOfSteel: 和 multiple load?02/12 00:10
3FManOfSteel: 參考這個網頁:https://en.cppreference.com/w/c/lang02/12 00:19
4FManOfSteel: uage/memory_model.html02/12 00:19
5FManOfSteel: 這一段話:When an汢valuation漑f an expression writ02/12 00:20
6FManOfSteel: When an汢valuation of an expression writes to a me02/12 00:21
7FManOfSteel: and another evaluation reads or modifies the same02/12 00:21
8FManOfSteel: memory location, the expressions are said to氲onf02/12 00:21
9FManOfSteel: 所以data race 是只要有一個 write 搭配其它 read 或w02/12 00:25
10FManOfSteel: rite 就會是發生。02/12 00:25
首頁
上一頁
1
下一頁
尾頁