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

作者: leolarrel (真.粽子無雙)   2012-12-15 00:23:09
※ 引述《cty222 (縱裕)》之銘言:
: 小弟寫了一支關於 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); <

Links booklink

Contact Us: admin [ a t ] ucptt.com