[问题] 关于多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