[PD] What exactly is a "stack overflow" ?

Jamie Bullock jamie at postlude.co.uk
Thu Dec 20 09:44:05 CET 2007


On Thu, 2007-12-20 at 00:15 +0000, Andy Farnell wrote:

> Perhaps we can reach a reasonable compromise in source.
> If you knew that an accidentally banged until would give up
> after a couple of minutes it wouldn't be so bad.

IMO [until] should just not hang Pd that's all. I don't think that a
warning should be thrown when you do |bang( -> [until], or that it
should have a built in limit.

This is in the same sense that you don't get a warning when you do
'while 1:' in Python or while(1){ } or whatever in other languages.
'while 1:' doesn't hang the interpreter (at least not in the Python
implementation I use), and |bang( -> [until] shouldn't hang Pd. 

Actually on my machine |bang( -> [until] runs at ~99% CPU and hangs Pd,
'while 1:' in Python runs at more like 69% and is interruptible with
ctrl-c leaving you back in the interactive interpreter unscathed. 

Perhaps a usleep() is in order on each iteration?

Jamie

-- 
www.postlude.co.uk





More information about the Pd-list mailing list