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: Tue, 3 Nov 2020 18:34:53 +0100 Lines: 34 Message-ID: References: <6d2d33cc-9b19-469c-a25c-d8d2f862f0aco@googlegroups.com> <3r7tpfhth4n7toe3figrnvl9jr3ottf580@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net rbnu/E7bKqzCPl8uhQ8iugwXuPFwTcS0KhHQ5cJ6KuLrpARVIw Cancel-Lock: sha1:WJcw3UtKPxhcZGATb/2cNdv378o= In-Reply-To: Xref: csiph.com comp.lang.javascript:39110 John G Harris: > On Sun, 1 Nov 2020 21:07:57 +0100, Arno Welzel > wrote: > > >> Again: threads in software have nothing to do with CPU cores. Even a >> single core single threaded CPU you run multithreaded software. The only >> difference is the lower performance due to the context switches >> neccessary for the CPU to handle different threads and the fact that >> multiple cores can run more multiple threads at the same time. > > Are you saying that every operating system that runs web browsers > guarantees to do time-slicing of threads if it can't do any better? No, that is not what I am saying. I said, that multiple cores are not a requirement to run multithreaded software. > 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. However other threads or processes may still run fine as long as the OS uses preemptive multitasking. This already worked fine in the days of the 68000 and Atari ST with MiNT or MagiC instead of TOS. -- Arno Welzel https://arnowelzel.de