[R] Odd scheduling behavior of R on Windows

David Hinds David_Hinds at perlegen.com
Thu Feb 20 21:06:03 CET 2003

I'm using R-1.6.1 on a dual Xeon system running Windows XP.  
When I have two compute intensive programs running in the 
background, and I start a calculation in an interactive R 
session, that calculation gets just a few percent of the 
available CPU time.  This is true even if I use the task 
manager to set the priority of the background jobs to "low" 
and the R session to "high".  Scheduling of the background 
jobs seems to behave as expected; if I start more than two, 
then jobs with higher priority get more CPU time than jobs 
with lower priority.  So it seems to be R that is behaving 

R seems to get its full allotment of CPU time when I invoke
single internal functions that take a significant amount of 
time to run.  It is starved when I run more complex R code
that is accumulating results of several thousand small
linear regressions.

Is this a known issue?  I'm not sure what could cause this; 
perhaps R is yielding the processor when the GUI checks for 
interactive events, and is getting starved for CPU time 
because it is yielding too frequently?  If these GUI checks
happen between execution of R statements, then perhaps there
should be a way to throttle the frequency of the checks, or
an option to disable them?

-- Dave Hinds

More information about the R-help mailing list