Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.javascript Subject: Re: boolean while loops "how to stop" and "make room for textout to textarea" Date: Wed, 4 Nov 2020 15:17:28 +0100 Lines: 26 Message-ID: References: <6d2d33cc-9b19-469c-a25c-d8d2f862f0aco@googlegroups.com> <3r7tpfhth4n7toe3figrnvl9jr3ottf580@4ax.com> <708255df-d1f2-4753-9dde-ab7ff2f770dbo@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net u60CBLI1zM9rcnZ8+9GvlgcL/TZG6fzNX07nE3scBCSaiF2zcC Cancel-Lock: sha1:Gc44JFvkOwN2Al3IAunHgAcorvY= In-Reply-To: <708255df-d1f2-4753-9dde-ab7ff2f770dbo@googlegroups.com> Xref: csiph.com comp.lang.javascript:39115 Julio Di Egidio: > On Tuesday, 3 November 2020 18:35:06 UTC+1, Arno Welzel wrote: >> John G Harris fantasised: > >>> That is, a forever loop is guaranteed to be paused from time to time >>> without that being requested by the thread code. >> >> No, a forever loop will block the current thread and a JavaScript >> executes a script in the browser only in one single thread. > > JS executes in one thread everywhere (Node, JS.NET, etc.), not just > in the browser: event-driven is its very *runtime model*. So what? I did say that is is *only* in a browser this way. > That said, an infinite loop without async calls or at last some sleep > is a CPU-choking nonsense in any language... Except when you need to get things done and CPU usage is less important than the time needed to finish a job. -- Arno Welzel https://arnowelzel.de