[問題] 關於多process執行順序 (QT)

作者: cty222 (縱裕)   2012-12-13 15:59:54
小弟寫了一支關於 share memory 的程式
裡面加入了類似hand shake的機制
一開始兩支C code compiler 工作正常
後來其中一支C code改成用QT compiler就不正常了
節取問題code如下
*share 是共享記憶體
C code QT code
1. *share = 0 ; *share=0;
2. while(*share==1); while(*share!=2){
*share = 1 ;
sleep(1); <
作者: shietsd (123)   2012-02-18 03:57:00
你是不是一直在 fork() process ?

Links booklink

Contact Us: admin [ a t ] ucptt.com