igor 

I like the idea. It provides a solution not depending on the scheduler strategy.
We should implement it :)

Stef

On Aug 8, 2011, at 10:42 PM, Igor Stasenko wrote:

> On 8 August 2011 22:17, Sean P. DeNigris <[email protected]> wrote:
>> 
>> Igor Stasenko wrote:
>>> 
>>> the problem is that you cannot interrupt
>>> it, by pressing Alt-. (or Cmd-. on macs)?
>>> 
>> 
>> Right, smart ass ;-)
> 
> Well, it works for me, if i press it multiple times :)
> 
> InputEventFetcher default eventHandlers
> 
> an OrderedCollection(an InputEventSensor an UserInterruptHandler)
> 
> So, all logic whether interrupt the process or not, is in #handleUserInterrupt
> 
> i think we should change it:
> 
>                       toInterrupt := Processor preemptedProcess.
>                       "Only interrupt processes which are potentially 
> blocking the UI"
>                       toInterrupt priority <  UIManager default uiProcess 
> priority
> ifTrue: [toInterrupt := Project uiProcess].
>                       
>                       "Fork at lower priority to avoid interrupting 
> system-critical processes"
>                       toInterrupt debugWithTitle: 'User Interrupt']
>                               forkAt: Processor activeProcess priority -1
> 
> the #preemptedProcess is not works, because it actually tries to
> guess, which process was preempted, instead of knowing it exactly.
> 
> What i think we should do is to extend the UserInterruptHandler to
> 
> a) have a registry of system-critical processes , which should never
> be interrupted: this is Delay, Event fetcher, interrupt handler,
>  weak finalizer, idle process
> All those facilities should register themselves in
> UserInterruptHandler whenever they deciding to start or restart their
> process.
> 
> 
> b) interrupt the first process, not found in (a), going from higher
> priority to lower.
> Then if you press the cmd-. multiple times, you will be able to
> interrupt anything which is not system-critical.
> 
> Because there is no reliable way to detect a processor hog process,
> unless you running CPU watcher and gather statistics on CPU
> consumption rates.
> Stopping a process which was running just before current one is like
> shooting in the clear sky in hope that duck will teleport right on the
> path of your bullet :)
> 
> -- 
> Best regards,
> Igor Stasenko AKA sig.
> 


Reply via email to