[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Error message for the failure to create heartbeat thread is too specific. (#540)
tim at rowledge.org
Tue Dec 22 00:14:31 UTC 2020
> On 2020-12-21, at 3:30 PM, smalltalking <notifications at github.com> wrote:
> The effect of this is that if the main Smalltalk thread runs continuously, for example is in some compute-intensive loop, then the heartbeat thread will be prevented from running, and hence events such as Delay expiry will not be checked for, and the main thread will never be interrupted.
> I doubt any modern OS does cooperative scheduling at any priority level. Without the increased priority, the heartbeat will still be scheduled but it may not interrupt the main thread at the intended time.
> Also, today's machines are almost all multi-core, so even if you keep a core busy with the main thread, another core may schedule the heartbeat process.
Well, yeah, that's really the point - you can't rely upon it. On some machines, with some versions of some OS it may work perfectly. On another day it might not.
The bit that has been bothering me recently with this is that a simple test program to try the priority raise seems to work but the nominally-the-same code in the actual VM tells me the raise failed. I'm not a fan of inconsistency.
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
There can never be a computer language in which you cannot write a bad program.
More information about the Vm-dev