Hi Vanessa,
 
Here's the original discussion:
https://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfoundation.org/thread/MK4XFVMRXEX63HXK6FLBLWFJKZ5CIWRR/

That's the one!  

Wow... I wrote almost the exact same thing 14 years ago!  Hilarious.  Thanks for sharing that.  :)

I guess we switched the default (Cog supports both, some other VMs do not) at some point without implementing an image-level scheduler? This would be better than the accidental round-robin behavior we get from the random interruptions by higher-level processes (it kinda works but is far from "fair").

I was only being descriptive, not making any judgement about one being "better" or worse (except in terms of the default setting).  I have no doubt first forked, first to finish with explicit yields are a desirable way to do same-priority Process scheduling in some cases.  

Having said that, Squeak's built-in switching due for networking and file operations creates optimizes throughput.  With processPremption set false, since those operations don't have explicit #yields, all of your same-level Processes are sitting ducks waiting for the front one to, for example, #waitForSendDone to finish over its 300 baud connection.  Processes pile up, and the CPU is idle instead of working on them and getting THEIR client responses on their way (you want Squeak to make the OS do as much as possible in as little time as possible, an idle CPU is antithetical to that).  It ends up being like serial execution without Processes at all in the first place.  If I'm wrong, and it IS switching between those equal priority processes in those circumstances, then that would seem to compromise the theoretical benefit of explicit cooperative scheduling.  I hope I will be corrected and learn something, but it seems like it's either going to be slow, or implicit switching anyway.

Best,
  Chris

 


Igor wrote about such a scheduler too:
https://computeradventures.wordpress.com/2009/05/04/new-schedulingsignals-for-squeak-vm-side/

Vanessa

On Mon, Mar 25, 2024 at 4:30 PM Chris Muller <asqueaker@gmail.com> wrote:
Hi Marcel,

true means Processes running at the same priority are given fair time, round-robin style, as higher-priority processes return or go back to sleep.  This code forcing it to false appears to have been the root cause of the recent issues with source.squeak.org's responsiveness.  Clients were timing out because one big request would cause a backlog of 10 small requests to queue up behind it and, often, timeout.  Simply setting this true in a startup patch script seems to have fixed it.

There are no good explanations in the code for false.  The only one I can remember from this mailing list I think was that you can get away easier not protecting your code with Semaphores, and instead depend on the known process switching behavior of the VM.  Perhaps for ultra high-performance applications?  It feels application-specific to me.  According to the comment, it also diverges from the Blue Book specification.

I don't mean to be disagreeable about the default, but true seems like the setting for smoother multitasking and more in the spirit of Squeak's liveness.  What is the rationale for false?

Best,
  Chris


On Mon, Mar 25, 2024 at 12:00 PM Taeumel, Marcel via Squeak-dev <squeak-dev@lists.squeakfoundation.org> wrote:
Ah, this was "we have a new VM feature" migration code. We no longer need it, I suppose.

Can we make sure that the ReleaseBuilder sets this to "false" by default? :-)

Best,
Marcel

Am 25.03.2024 00:28:07 schrieb commits@source.squeak.org <commits@source.squeak.org>:

Chris Muller uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-cmm.1562.mcz

==================== Summary ====================

Name: Kernel-cmm.1562
Author: cmm
Time: 24 March 2024, 6:27:34.572036 pm
UUID: 886bf6b9-a56b-4131-accf-3867a3836658
Ancestors: Kernel-ct.1561

Allow processPreemptionYields: to persist across image saves, as purported by its comment.

=============== Diff against Kernel-ct.1561 ===============

Item was changed:
----- Method: ProcessorScheduler class>>startUp: (in category 'background process') -----
startUp: resuming

- Smalltalk processPreemptionYields ifTrue: [
- Smalltalk processPreemptionYields: false].
-
resuming ifTrue: [
Smalltalk installLowSpaceWatcher.
self installIdleProcess].!