Another thing, which i think we should try is to put interrupt handler
ahead of event sensor handler
(because it should take priority above anything else),
so
InputEventFetcher default eventHandlers

should read:

 an OrderedCollection(an UserInterruptHandler an InputEventSensor )

but not

> an OrderedCollection(an InputEventSensor an UserInterruptHandler)


On 8 August 2011 22:42, Igor Stasenko <[email protected]> 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.
>



-- 
Best regards,
Igor Stasenko AKA sig.

Reply via email to