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

作者: cty222 (縱裕)   2012-12-18 00:24:09
※ 引述《leolarrel (真.粽子無雙)》之銘言:
: ※ 引述《cty222 (縱裕)》之銘言:
: : 好像寫的不清不楚...
: : 在多寫一些看能不能表達清楚...
: : 簡單的說我是直接將C code的共享記憶體寫法放進QT裡出了問題
: : 以下為共用碼
: : int main(void){
: : int shmid;
: : int *share ;
: : shmid = shmget(key,sizeof(int),IPC_CREAT|0644);
: : share = (int *)shmat( shmid, NULL, 0 ) ;
: : C code QT code
: : 1. *share = 0 ; | *share=0;
: : |
2. while(*share!=1){ | while(*share!=2){
: : printf("%d\n"*share);| *share = 1 ;
: : } | sleep(1); <
作者: KevinR (Kevin)   2012-02-20 19:21:00
volatile...

Links booklink

Contact Us: admin [ a t ] ucptt.com