Ctrl-Break

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Ctrl-Break

Jochen Riekhof-7
Hi...

given that I killed my Dolphin now for at least 10 times I wonder if there
is some hints about improving the Ctrl+Break behavior of Dolphin 6.
Actually, when evaluating something in a workspace that loops endlessly,
Ctrl-Break is not working at all. What causes Ctrl-Break to pop in and
interrupt. Can I include special calls in my critical sections that allow
Ctrl+Break?

I remember Ian added a goodie that saves the image every time, but I find
this a somewhat clumsy way out :-)

Ciao

...Jochen


Reply | Threaded
Open this post in threaded view
|

Re: Ctrl-Break

David Gorisek-5
Do it like this:

1. Evaluate:

      SessionManager current stdout

2. Now go into an endless loop.

3. Set window focus to the console window (black background) and press
Ctrl+Break.

This should work everytime.

Best regards,

David



Jochen Riekhof wrote:

> Hi...
>
> given that I killed my Dolphin now for at least 10 times I wonder if there
> is some hints about improving the Ctrl+Break behavior of Dolphin 6.
> Actually, when evaluating something in a workspace that loops endlessly,
> Ctrl-Break is not working at all. What causes Ctrl-Break to pop in and
> interrupt. Can I include special calls in my critical sections that allow
> Ctrl+Break?
>
> I remember Ian added a goodie that saves the image every time, but I find
> this a somewhat clumsy way out :-)
>
> Ciao
>
> ...Jochen
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Ctrl-Break

Jochen Riekhof-7
Hi David...

Great! Thank you!

Ciao

...Jochen


"David Gorisek" <[hidden email]> wrote in message
news:[hidden email]...

> Do it like this:
>
> 1. Evaluate:
>
>      SessionManager current stdout
>
> 2. Now go into an endless loop.
>
> 3. Set window focus to the console window (black background) and press
> Ctrl+Break.
>
> This should work everytime.
>
> Best regards,
>
> David
>
>
>
> Jochen Riekhof wrote:
>> Hi...
>>
>> given that I killed my Dolphin now for at least 10 times I wonder if
>> there is some hints about improving the Ctrl+Break behavior of Dolphin 6.
>> Actually, when evaluating something in a workspace that loops endlessly,
>> Ctrl-Break is not working at all. What causes Ctrl-Break to pop in and
>> interrupt. Can I include special calls in my critical sections that allow
>> Ctrl+Break?
>>
>> I remember Ian added a goodie that saves the image every time, but I find
>> this a somewhat clumsy way out :-)
>>
>> Ciao
>>
>> ...Jochen


Reply | Threaded
Open this post in threaded view
|

Re: Ctrl-Break

Jochen Riekhof-7
Hi David...

yelling too early :-(, does not work either it seems.
I evaluated SessionManager current stdout. Typed [] repeat and tried to
ctrl-break with focus in console - nothing happens.

Ciao

...Jochen


"Jochen Riekhof" <[hidden email]> wrote in message
news:[hidden email]...

> Hi David...
>
> Great! Thank you!
>
> Ciao
>
> ...Jochen
>
>
> "David Gorisek" <[hidden email]> wrote in message
> news:[hidden email]...
>> Do it like this:
>>
>> 1. Evaluate:
>>
>>      SessionManager current stdout
>>
>> 2. Now go into an endless loop.
>>
>> 3. Set window focus to the console window (black background) and press
>> Ctrl+Break.
>>
>> This should work everytime.
>>
>> Best regards,
>>
>> David
>>
>>
>>
>> Jochen Riekhof wrote:
>>> Hi...
>>>
>>> given that I killed my Dolphin now for at least 10 times I wonder if
>>> there is some hints about improving the Ctrl+Break behavior of Dolphin
>>> 6. Actually, when evaluating something in a workspace that loops
>>> endlessly, Ctrl-Break is not working at all. What causes Ctrl-Break to
>>> pop in and interrupt. Can I include special calls in my critical
>>> sections that allow Ctrl+Break?
>>>
>>> I remember Ian added a goodie that saves the image every time, but I
>>> find this a somewhat clumsy way out :-)
>>>
>>> Ciao
>>>
>>> ...Jochen
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Ctrl-Break

Chris Uppal-3
In reply to this post by Jochen Riekhof-7
Jochen,

> Actually, when evaluating something in a workspace that loops endlessly,
> Ctrl-Break is not working at all. What causes Ctrl-Break to pop in and
> interrupt.

I'm not sure of the details, but apparently the VM only checks for Ctrl-Break
at certain times.  If the code is locked in a loop which doesn't have such
occasions (such as a long running external call) then it'll never be
interrupted.  Ian has also commented that D6 seems less willing to be
interupted than D5.


> Can I include special calls in my critical sections that allow
> Ctrl+Break?

Does putting
    SessionManager current inputState pumpMessages
into you workspace loop help ?

Perhaps better -- or at least simpler -- you could replace your infinite loop
with:

    continue := true.
    [[continue] whileTrue:
        [
        ... looping code ...
        ]
    ] forkAt: 3.

which would allow you to "interrupt" by setting continue to false.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Ctrl-Break

Jochen Riekhof-6
Hi Chris...

Thank you for your hints. The pumpMessages seems to have no effect on
the Ctrl+Break behaviour. In fact I still do not see how to break out of
the loop, just the GUI remains responsive.

The continue is ok, but I am after a displayIt in a workspace, where
forking is not so nice. Of course I can program workarounds, but I am
99% of the cases ok with just displaying my computation results of my
algorithm in the workspace. Occasionally the input data is so weird that
the processing takes very long (days?). In this case I just want to
interrupt the call with Ctrl+Break. A conditional would not work as the
entire image is frozen on a display it.

If there is really no way to put a fast possibility for Ctrl+Break
checking (I imagine something like SessionManager current inputState
checkForCtrlBreak), I will probably check the computation duration and
break out after a minute or so.

Ciao

...Jochen


Reply | Threaded
Open this post in threaded view
|

Re: Ctrl-Break

Christopher J. Demers
"Jochen Riekhof" <[hidden email]> wrote in message
news:[hidden email]...
...
> If there is really no way to put a fast possibility for Ctrl+Break
> checking (I imagine something like SessionManager current inputState
> checkForCtrlBreak), I will probably check the computation duration and
> break out after a minute or so.

Try something like this:

[Keyboard default isCancelPressed ifTrue: [self halt]] repeat.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: Ctrl-Break

Jochen Riekhof-6
Hi Chris...

yep, this works just fine. Thanks a lot!


Ciao

...Jochen


P.S.
Of course I am still interested about the possibility to get a working
Ctrl-Break in the base system :-).