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

作者: leolarrel (真.粽子無雙)   2012-12-17 20:12:08
※ 引述《cty222 (縱裕)》之銘言:
: 好像寫的不清不楚...
: 在多寫一些看能不能表達清楚...
: ※ 引述《leolarrel (真.粽子無雙)》之銘言:
: 簡單的說我是直接將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); <

Links booklink

Contact Us: admin [ a t ] ucptt.com