Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: saito Newsgroups: comp.lang.tcl Subject: Re: too many nested evaluations (infinite loop?) Date: Sun, 22 Jun 2025 16:10:23 -0400 Organization: A noiseless patient Spider Lines: 21 Message-ID: <1039nvg$njco$1@dont-email.me> References: <1037i2r$1bp7c$1@dont-email.me> <1039fkp$lhcg$1@dont-email.me> <1039lfa$n2fg$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 22 Jun 2025 22:10:25 +0200 (CEST) Injection-Info: dont-email.me; posting-host="4911d99e9b817f4ef2ee20d434dc79e7"; logging-data="773528"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kNqhKzTStZ8wrqSDlr1Cy" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:smENGJNLISS5b8s8qDItNODDqbY= Content-Language: en-US In-Reply-To: <1039lfa$n2fg$1@dont-email.me> On 6/22/2025 3:27 PM, Jonathan Kelly wrote: > > But isn't the TCL event loop single threaded? This is a good question. With event driven applications, you usually don't have a main line of thread that is executing constantly. In that case, yes, the events may not fire. However, with such applications, events are fired and processed repeatedly. So they may indeed interfere with each other. Here is a nice sample code. See how they intermingle: proc timer1 {} {puts -nonewline .; after 100 timer1} proc timer2 {} {puts TIMER....................; after 1000 timer2} after 1000 timer2; after 100 timer1