XTWORKPROC USING EXESSIVE CPU TIME

ITEM: RTA000030912



QUESTION:                                                                       
My customer is using XTWorkProc to peek at the X event queue and                
invoke a registered function whenever there are no events pending.              
It appears that the XTWorkProc code is implemented with ioctl and               
it ends up using a large % of CPU time.  The customer is wondering              
why ioctl vs a select and would like to know how the signal                     
function is implemented and why does this cause so  much CPU.                   
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
The excessive cpu usage that you observe is normal.                             
XtWorkProc will use a lot of CPU because instead of block waiting for           
next event, the registered function in XtWorkProc is called repeatedly.         
There is no ioctl() or select() in XtWorkProc. The only thing it does is        
register the callback function. At runtime in the XtMainLoop(), if there        
is nothing to do, the registered function will be called.                      
You may want to look at XtAddTimeOut() and XtAddInput() functions. These        
functions will block waiting for timer or events, thus consume less CPU.        
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
                                                                                
                                                                                
This item was created from library item Q627066      CDTZF                      
                                                                                
Additional search words:                                                        
AIXWINDOWS APR93 CDTZF CPU CUSING ENVIRONMENT EXESSIVE IX PROCESSOR             
RISCSYSTEM RISCXWIN SOFTWARE TIME TIMER XTWORKPROC                              
                                                                                
                                                                                
                                                                                
                                                                               


WWQA: ITEM: RTA000030912 ITEM: RTA000030912
Dated: 11/1996 Category: RISCXWIN
This HTML file was generated 99/06/24~12:43:12
Comments or suggestions? Contact us