Blogtrottr
|
[請問] 軟體的互斥鎖問題
Jul 11th 2013, 23:15, by luxylu
作者luxylu ( 露西露 )
站內ask
標題[請問] 軟體的互斥鎖問題
時間Thu Jul 11 23:15:33 2013
/* program 1 */ turn = 1; Q1 = TRUE; while (turn == 1 && Q2 == TRUE); Critical Section; Q1 = FALSE; /* program 2 */ turn = 2; Q2 = TRUE; while (turn == 2 && Q1 == TRUE); Critical Section; Q2 = FALSE; 這兩個程式用一個processor執行下,會有互斥以進入Critical section時 請問什麼情況下此互斥鎖會失效呢? 查過了Dekker演算法但看不懂如何操作 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.109.41.16
→ Raist:...一定要問這種高難度的問題來質疑我的智商嗎??? (淚奔~) 07/11 23:24
→ luxylu:我也不想阿.....已經查了三天資料還是看不懂 07/11 23:28
推 wuliou:有第三個process更改了turn的值? 07/11 23:32
→ wuliou:或是碰到非atomic指令? 07/11 23:32
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html
|
|
|
yuahong1
急診室男女線上看 第2集 急診室男女線上看 第3集 急診室男女線上看 第4集 急診室男女線上看 第5集
yuahong1 發表在 痞客邦 留言(0) 人氣()