[BUG][FIX] interrupt driven EventSensor ( could somebody provide detailed review, please? )

John M McIntosh johnmci at smalltalkconsulting.com
Fri Aug 1 22:58:58 UTC 2003


> John M McIntosh <johnmci at smalltalkconsulting.com> wrote:
>> b) If mouse information is only updated every 17ms or 10ms? does it
>> make sense to read them 10 times per ms?
>> (hint as far as I can tell on the mac updates sensor data about every
>> 17ms)
>> Table PC (if any exist) do they update every 5ms, every ms?  do we  
>> care?
>>
>
> IMHO, if someone is busy-polling the sensor then it is acceptible to
> spike the CPU as they have requested.
>
> On the other hand, scattering Delay's all around seems dangerous.  Just
> imagine down the line the poor sucker (probably one of the people
> reading this thread!) who has to undo the delay in just some cases the
> method is called.  It sounds like an ever growing mess as we try to
> figure out which calls get the delay and which ones do not.

Na, the delay is all refactored into one routine, with another routine  
for tapping the semaphore
if you didn't want the delay. That came out of a conversation last  
month about spinning the CPU on
sensor data and that one should really do a delay so other work can  
happen if the sensor data
only changes every 1/60 of second or worse. I still think busy polling  
the sensor is poor programming because on
my mac like any other unix system other tasks are running, and even in  
squeak I've got a few processes running too. why
should everything grind to a halt to watch the cursor?

>
> Hey, didn't MacOS 8 or 9 or automatically lower the CPU usage of any
> process that is busy polling for events?  Squeak people hated this.  :)
> But it seems like what a delay in the polling method would accomplish.

No, the issue was that doing a waitnextevent needed for polling of  
events would give up time for other
tasks to run collaborative multi-processing , problem was you didn't  
know how long those other tasks would take.
That would cause benchmark issues etc etc. In OS-8 & 9  more true  
multiprocessing was introduced
into the OS kernel to allow specially written software shared access to  
the CPU.

--
======================================================================== 
===
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