ProcessorScheduler.st
changeset 302 1f76060d58a4
parent 271 624d7d25dcea
child 308 f04744ef7b5d
--- a/ProcessorScheduler.st	Tue Mar 07 22:55:20 1995 +0100
+++ b/ProcessorScheduler.st	Thu Mar 09 00:40:27 1995 +0100
@@ -17,7 +17,8 @@
 				readFdArray readSemaphoreArray readCheckArray
 				writeFdArray writeSemaphoreArray
 				timeoutArray timeoutActionArray timeoutProcessArray timeoutSemaphoreArray
-				idleActions anyTimeouts dispatching interruptedProcess'
+				idleActions anyTimeouts dispatching interruptedProcess
+				useIOInterrupts'
 	 classVariableNames:'KnownProcesses KnownProcessIds
 			     PureEventDriven
 			     UserSchedulingPriority 
@@ -33,7 +34,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.31 1995-02-19 16:14:17 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.32 1995-03-08 23:39:20 claus Exp $
 '!
 
 Smalltalk at:#Processor put:nil!
@@ -56,7 +57,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.31 1995-02-19 16:14:17 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.32 1995-03-08 23:39:20 claus Exp $
 "
 !
 
@@ -86,7 +87,8 @@
     system, where either a process is forked, or a timeout is used instead 
     (for examples, see ProcessMonitor or MemoryMonitor).
 
-    This pure-event mode may not be supported in the future.
+    This pure-event mode may not be supported in the future (actually, it is no longer
+    maintained in places where was present).
 
     class variables:
 
@@ -457,6 +459,7 @@
     timeoutProcessArray := Array with:nil.
     anyTimeouts := false.
     dispatching := false.
+    useIOInterrupts := OperatingSystem supportsIOInterrupts.
 
     "
      handcraft the first (dispatcher-) process - this one will never
@@ -1053,8 +1056,8 @@
     ].
 
     "first do a quick check for semaphores using checkActions - this is needed for
-     devices like X-connection, where some events might be in the event
-     queue. Without these, a select might block even though there is work to do
+     devices like the X-connection, where some events might be in the event
+     queue. Without these checks, a select might block even though there is work to do
     "
     any := false.
     nActions := readCheckArray size.
@@ -1083,18 +1086,21 @@
 
     pri := p priority.
 
-    "want to give control to the process p.
+    "
+     want to give control to the process p.
      If the switched-to processes priority is lower than the
      userSchedulingPriority, we have to make certain, that the 
      next input or timer will bring us back for a reschedule.
      This is done by enabling ioInterrupts for all file descriptors.
-     If ioInterrupts are not available, we schedule a timer interrupt 
-     to interrupt us after 1/20s of a second - effectively polling 
-     the filedescriptors. - which is very bad, since low prio processes
-     will be hurt in performance 
-     - dont let benchmarks run with low prio ...
+     If ioInterrupts are not available (OS does not support them), 
+     we schedule a timer interrupt to interrupt us after 1/20s of a second
+     - effectively polling the filedescriptors 20 times a second.
+     (which is bad, since low prio processes will be hurt in performance)
+     Therefore, dont let benchmarks run with low prio ...
+
      Higher prio processes must be suspended, 
-     same prio ones must yield or suspend to get back control"
+     same prio ones must yield or suspend to get back control
+    "
 
 "
  uncommenting this will make timeouts interrupt the current process
@@ -1115,7 +1121,7 @@
 
     "
      if the process to run has a lower than UserInterruptPriority,
-     arrange for an interrupt to occur on IO.
+     arrange for an interrupt to occur on I/O.
      This is done by enabling IO-signals (if the OS supports them)
      or by installing a poll-interrupt after 50ms (if the OS does not).
     "
@@ -1128,7 +1134,7 @@
 	].
 "---"
 
-	OperatingSystem supportsIOInterrupts ifTrue:[
+	useIOInterrupts ifTrue:[
 	    readFdArray do:[:fd |
 		fd notNil ifTrue:[
 		    OperatingSystem enableIOInterruptsOn:fd
@@ -1187,7 +1193,7 @@
     |aTime now delta minDelta n "{ Class: SmallInteger }"|
 
     "find next timeout. since there are usually not many, just search.
-     If there where many, the list should be kept sorted ... keeping deltas
+     If there were many, the list should be kept sorted ... keeping deltas
      to next (as in Unix kernel)"
 
     n := timeoutArray size.