--- a/ProcSched.st Thu May 12 04:07:15 1994 +0200
+++ b/ProcSched.st Tue May 17 12:09:46 1994 +0200
@@ -17,7 +17,8 @@
readFds readSemaphores readChecks
writeFds writeSemaphores writeChecks
timeouts timeoutActions timeoutSemaphores
- idleActions anyTimeouts dispatching'
+ idleActions anyTimeouts dispatching
+ timeoutProcess'
classVariableNames:'KnownProcesses KnownProcessIds
PureEventDriven
UserSchedulingPriority TimingPriority'
@@ -30,7 +31,7 @@
COPYRIGHT (c) 1993 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.15 1994-05-12 02:07:15 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ProcSched.st,v 1.16 1994-05-17 10:08:39 claus Exp $
'!
Smalltalk at:#Processor put:nil!
@@ -42,7 +43,7 @@
setup some priority values."
KnownProcesses isNil ifTrue:[
- KnownProcesses := WeakArray new:5.
+ KnownProcesses := WeakArray new:10.
KnownProcesses watcher:self.
KnownProcessIds := OrderedCollection new.
@@ -55,10 +56,15 @@
Processor := self new.
].
+
+ "
+ allow configurations without processes
+ "
PureEventDriven := self threadsAvailable not.
PureEventDriven ifTrue:[
'no process support - running event driven' errorPrintNewline
].
+
UserSchedulingPriority := 8.
TimingPriority := 16.
!
@@ -354,9 +360,12 @@
anyTimeouts := false.
dispatching := false.
- "handcraft the first (dispatcher-) process - this one will never
+ "
+ handcraft the first (dispatcher-) process - this one will never
block, but go into a select if there is nothing to do.
- Also it has a prio of max+1"
+ Also, it has a prio of max+1 - thus, it comes first when looking
+ for a runnable process.
+ "
activeProcess := Process new.
activeProcess setId:0.
@@ -480,6 +489,11 @@
id := self class threadCreate:aBlock.
id isNil ifTrue:[
+ "
+ this may happen, if the VM does not support more processes,
+ or if it ran out of memory, when allocating internal data
+ structures
+ "
self error:'cannot create new Process'.
^ nil
].
@@ -513,7 +527,12 @@
quiescentProcessLists at:prio put:nil
]
].
- "no process to run - this cannot happen"
+ "
+ no process to run - this 'cannot' happen
+ (well, not quite: it may happen if the scheduler process is
+ suspended - which btw. should be avoided, since noone is there
+ to schedule processes then)
+ "
self halt:'fatal dispatcher should never be suspended'.