ProcSched.st
changeset 2258 8894d33af5f6
parent 2198 0537156f1fd7
child 2262 4c4d810f006f
equal deleted inserted replaced
2257:1d9e88f6550e 2258:8894d33af5f6
  1724 
  1724 
  1725     timeSliceProcess notNil ifTrue: [^ self].
  1725     timeSliceProcess notNil ifTrue: [^ self].
  1726 
  1726 
  1727     timeSliceProcess := [
  1727     timeSliceProcess := [
  1728         [
  1728         [
       
  1729             |myDelay t|
       
  1730 
       
  1731             myDelay := Delay forMilliseconds:(t := TimeSliceInterval).
       
  1732 
  1729             [true] whileTrue: [
  1733             [true] whileTrue: [
  1730                 Delay waitForMilliseconds:TimeSliceInterval.
  1734                 t ~~ TimeSliceInterval ifTrue:[
       
  1735                     "/ interval changed -> need a new delay
       
  1736                     myDelay delay:(t := TimeSliceInterval).
       
  1737                 ].
       
  1738                 myDelay wait.
  1731                 self slice
  1739                 self slice
  1732             ]
  1740             ]
  1733         ] valueOnUnwindDo:[
  1741         ] valueOnUnwindDo:[
  1734             timeSliceProcess := nil
  1742             timeSliceProcess := nil
  1735         ]
  1743         ]
  1738     timeSliceProcess name:'time slicer'.
  1746     timeSliceProcess name:'time slicer'.
  1739     timeSliceProcess beSystemProcess.
  1747     timeSliceProcess beSystemProcess.
  1740     timeSliceProcess resume.
  1748     timeSliceProcess resume.
  1741 
  1749 
  1742     "
  1750     "
  1743      Processor startTimeSlicing
  1751      Processor stopTimeSlicing.
       
  1752      Processor startTimeSlicing.
  1744     "
  1753     "
  1745 
  1754 
  1746     "Created: 17.1.1997 / 16:42:02 / cg"
  1755     "Created: 17.1.1997 / 16:42:02 / cg"
  1747     "Modified: 17.1.1997 / 21:58:36 / cg"
  1756     "Modified: 24.1.1997 / 21:34:24 / cg"
  1748 !
  1757 !
  1749 
  1758 
  1750 stopTimeSlicing
  1759 stopTimeSlicing
  1751     "stop preemptive scheduling (timeSlicing)"
  1760     "stop preemptive scheduling (timeSlicing)"
  1752 
  1761 
  2476 ! !
  2485 ! !
  2477 
  2486 
  2478 !ProcessorScheduler class methodsFor:'documentation'!
  2487 !ProcessorScheduler class methodsFor:'documentation'!
  2479 
  2488 
  2480 version
  2489 version
  2481     ^ '$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.114 1997-01-17 20:59:50 cg Exp $'
  2490     ^ '$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.115 1997-01-24 20:45:13 cg Exp $'
  2482 ! !
  2491 ! !
  2483 ProcessorScheduler initialize!
  2492 ProcessorScheduler initialize!