[squeak-dev] Re: Interaction between objects which can be waited on, and their clients(waiters)

Igor Stasenko siguctua at gmail.com
Tue May 5 19:58:11 UTC 2009


2009/5/5 Andreas Raab <andreas.raab at gmx.de>:
> Igor Stasenko wrote:
>>
>> 2009/5/5 Andreas Raab <andreas.raab at gmx.de>:
>>>
>>> How is what you are proposing fundamentally different from a solution
>>> that
>>> simply creates a watcher process for each event source and then combines
>>> those properly? I.e.,
>>
>> the fundamental difference that by adding the protocol
>> (waitForSignalBy:/waitComplete:) i can put any waiter to the
>> semaphore, instead of just process.
>
> And I have absolutely no clue what you mean when you say that ;-) To me, the
> concept of "waiting" is intrinsically tied to the concept of "progressing"
> and only processes can do either. It is meaningless to me to say "this
> number is waiting" - only active objects (processes) can wait since only
> active objects (processes) can advance.
>
> Can you explain in more detail what it *means* for an object other than a
> process to wait? I just don't get it.
>

Okay, the current semaphore/process interaction is based on an
implicit scheme which can be illustrated as:
process do: something after: signal/event.

this is exactly as you saying, intrinsically, a process can't advance
when its waiting on semaphore.
But at the same time, a Processor can advance, and it is, otherwise it
would be impossible to have scheduling/task switching.

If we look deeper, a #do:after: scheme is implemented on more basic
scheme, which can be illustrated as:
object on: signal/event  do: something, which, in case of
Semaphore/Delays is nothing more than an observer pattern.
So, what i proposing is to employ a custom observer pattern for event
sources (Semaphores, Delays) and for the event consumers - Processes,
or any other objects.

This is possible now, because in new scheduler the 'intrinsic' #on:do:
scheme has moved from VM to language side.
So, what stops us from having this as a basic interaction layer,
instead of #do:after: ?


> Sorry for being slow,
>  - Andreas
>


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list