Version 5 of Am I heading for trouble if I use re-entrant procedures?

Updated 2009-08-06 13:35:59 by dkf

I like the idea of re-entrant procedures to do various sub-processes at differing time intervals; something like:

proc dothis {delay} {
    # do something here
    after $delay dothis
}

My concern is that ultimately I might run into stack problems or memory problems that will make the calling application become unstable.

Am I right to be concerned or is it not a problem?

If it is a problem then what would be a better way to handle this concept?

Be gentle! Concepts such as threads and mutex etc. are a tad foreign to me :)

Regs.


Your example does not use threads, nor is it re-entrant, nor does it experience unbounded stack or memory usage growth.

See every for the more polished realization.


I suggest that you use comp.lang.tcl for asking questions rather than cluttering the wiki with stuff that is misleading rather than informative. You'll probably get a quicker response anyway.