programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: SF GUI hangs

From: Jerry Avins <jya_at_ieee.org>
Date: Wed, 11 Sep 2002 18:58:16 -0400

Rick,

Thanks for the details. I hadn't known that this is expected behavior
with pernicious (buggy; data dependent) code. This wasn't a plea for
help; I know how to fix my code. " > " is for signed numbers. I need
" U> ".

Jerry

rick wrote:
>
> Jerry,
>
> What your code did was enter a loop where the process thread never
> checked for messages. Without a message dispatcher running, no window
> activity is possible. Programs written in C or anything else that do
> an equivalent algorithm will have the same behavior.
>
> A possible answer is an independent thread that "owns" the SwiftForth
> process and can cause it to abort on demand. I have experimented with
> such a technique, but never had results that I really liked.
>
> Rick
>
> > : ascends ( n1 n2 -- lesser greater )
> > \ ascends arranges the top two numbers on the stack in ascending order.
> > 2DUP > IF SWAP THEN ;
>
> > : GCD ( u1 u2 -- u ) \ GCD computes the greatest divisor of n1 and n2.
> > BEGIN ascends OVER MOD DUP 0= UNTIL DROP ;
>
> > "-3 100 GCD" executes, while "3 -100 GCD" hangs. The point is not that
> > good code exposes a bug in Forth, but that bad (unsafe) code crashes the
> > window, blocking <alt> and the red "break" icon. Any thoughts?
>
> ----------------------------------------------------------------------
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Search the archives! Visit http://www.forth.com/search for details.
Received on Wed Sep 11 2002 - 15:58:27 PDT

This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:03 PST