noidle

2018-11-11 16:24 更新

 原型:extern void noidle(void);
             
 用法:#include <system.h>
 
 功能:調(diào)用系統(tǒng)例程
 
 說明:文曲星是單任務(wù)系統(tǒng),為防止應(yīng)用程序占用過多的系統(tǒng)時(shí)間而影響系統(tǒng)程序的執(zhí)行
       同時(shí)也為了防止個(gè)別程序崩潰而造成系統(tǒng)無法啟動(dòng),文曲星內(nèi)核在中斷到來時(shí)會(huì)檢
       測(cè)應(yīng)用程序所執(zhí)行的時(shí)間,如果在4秒內(nèi)系統(tǒng)程序沒有得到運(yùn)行,則中斷程序?qū)?qiáng)迫
       文曲星進(jìn)入睡眠狀態(tài),即所謂的死機(jī)。
       因此,當(dāng)程序運(yùn)算時(shí)間過長(zhǎng)(一般為循環(huán)過程)時(shí),請(qǐng)調(diào)用noidle來防止系統(tǒng)關(guān)機(jī)。

 舉例:

     // noidle.c
     
     #include <system.h>
     main()
     {
       int i,j;
       clrscr();
       printf("Waiting...\n");
       for(i=0;i<10;i++)
         for(j=0;j<32767;j++)
         {
           noidle();
         }
       
       printf("System Shutdown?");
       
       getchar();
       return 0;
     }


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)