bug in delay?

John M McIntosh johnmci at smalltalkconsulting.com
Tue Jan 6 01:20:40 UTC 2004

Yes, and the AccessProtect critical: [
part is should prevent the sorted collection referred to by   
SuspendedDelays from being altered as the add: is being run on the  

So, either:
a) the critical: is failing to work?
b) AccessProtect is getting excessive semaphores signals from  
somewhere, somehow?
c) SuspendedDelays is being altered outside of a  AccessProtect  
critical: block.?

My casual look this morning doesn't appear to show case (c) being true.  
I've not considered cases (a) or (b), and I could have missed
an issue with (c)

However it could be image change related?  Doing a Semaphore  
allInstances do: [:s | s signal] could have interesting side effects...

Then again some other eyes should look and see if they can see the  
wrong assumption that has been made?

On Jan 5, 2004, at 9:59 AM, marcelo Cortez wrote:

> Hi John
> >Mmm, I seem to recall Dan Ingalls, Bill Shauck, Samuel S. Shuster and  
> I
> >were in there a few years back to
> >prove that the clock roll over logic had a bug where it wouldn't reset
> >the resumption time correctly in certain cases. Leaving
> >Dan's weather station software hung.
> >Assuming we are talking about SuspendedDelays which is created as:
> >SuspendedDelays _
> >SortedCollection sortBlock:
> >[:d1 :d2 | d1 resumptionTime <= d2 resumptionTime].
> >I would suggest you look at all users of SuspendedDelays in your image
> >and confirm that it's protected by
> >AccessProtect. In a quick look before adequate coffee I don't see why
> >it's broken if I  assume something is altering
> >SuspendedDelays as the add: logic is running.  You might need to look
> >at callers of certain methods to find the wrapping
> >critical: block.
> **   here is where the stack trace show the error
> this colaboration occurs into  AccesProtect critical
> Delay>>schedule
> schedule
>  "Private! Schedule this Delay, but return immediately rather than  
> waiting.
> The receiver's semaphore will be signalled when its delay duration has
> elapsed."
>  beingWaitedOn ifTrue: [self error: 'This Delay has already been
> scheduled.'].
>  AccessProtect critical: [
>   beingWaitedOn _ true.
>   resumptionTime _ Time millisecondClockValue + delayDuration.
>   ActiveDelay == nil
>    ifTrue: [self activate]
>    ifFalse: [
>     resumptionTime < ActiveDelay resumptionTime
>      ifTrue: [
>       SuspendedDelays add: ActiveDelay.
>       self activate]
>      ifFalse: [SuspendedDelays add: self  (** HERE FIRE ERROR )  ]]].
> Best regards
>  MDC
> <image.tiff>¿Buscás un auto?
> Encontralo en Yahoo! Autos
> ¡Más de 4000 clasificados todos los días!
> Usados - 0 km -Vendé el tuyo
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com

More information about the Squeak-dev mailing list