-- Copyright (C) 1984  by Xerox Corporation. All rights reserved. 
-- Idler.mesa, HGM, 19-Apr-84 17:01:59

DIRECTORY
  Process USING [MsecToTicks, Pause, SetPriority, Ticks],
  ProcessorFace USING [SetMP],
  ProcessPriorities USING [priorityIOHigh],
  
  CpuIdle USING [GetSmoothedCpuUtilization];

Idler: PROGRAM
  IMPORTS ProcessorFace, Process, CpuIdle =
  BEGIN
  
  blinker: PROCESS = FORK Blinker[];
  
  Blinker: PROCEDURE =
    BEGIN
    ticks: Process.Ticks = Process.MsecToTicks[1000];
    Process.SetPriority[ProcessPriorities.priorityIOHigh];
    DO
      Process.Pause[ticks];
      ProcessorFace.SetMP[CpuIdle.GetSmoothedCpuUtilization[]];
      ENDLOOP;
    END;
    
  END.....