Ahhh... gmail pre-emptive send strikes again.... To continue...

I am curious about the recursive calls to
ZdcSecureSocketStream(ZdcSimpleSocketStream)>>fillReadBuffer
and multiple accumulations from DelayExperimentalSpinScheduler>>unschedule:
but that method doesn't really do a lot. I wouldn't expect the
whileTrue loop to be spinning much, but you could examine that by
trying something like...

Object subclass: #SpinCount
   instanceVariableNames: 'counter'
   classVariableNames: ''
   package: 'Play'

SpinCount>>initialize
   counter := 0.

SpinCount>>count
   counter := counter + 1.

SpinCount>>printOn: aStream
   super printOn: aStream.
   aStream nextPut: $=.
   counter printOn: aStream.

DelayMicrosecondScheduler subclass: #DelayExperimentalSpinScheduler
   instanceVariableNames: ''
   classVariableNames: 'Tally'
   package: 'Kernel-Processes'

DelayExperimentalSpinScheduler class >> startTally
   Tally := WaitfreeQueue new.

DelayExperimentalSpinScheduler class >> endTally
   |result finalTally|
   finalTally := Tally.
   Tally := nil.
   result := OrderedCollection new.
   finalTally flush: [ :item | result add: item ].
   ^ result

DelayExperimentalSpinScheduler >> unschedule: aDelay
   |spinCount|
   "self startTally"
   "self endTally inspect"
   spinCount  := SpinCount new.
   Tally ifNotNil: [Tally nextPut: spinCount].
   aDelay schedulerBeingWaitedOn ifTrue: [^self error: 'This Delay has
already been scheduled.'].
   [ Tally ifNotNil: [spinCount count].
      scheduledDelay == nil ifTrue: [
           scheduledDelay := aDelay.
           timingSemaphore signal.
          ^self].
      true.
   ] whileTrue.


Actually, I wonder does the "timingSemaphore signal" invoking the
priority 80 DelaySchedulingProcess to wake up and run above the
priority of the profiler?  So all of that activity gets attributed to
#unschedule:  ???

cheers -ben

Reply via email to