Just a bit of musing

claw at null.net claw at null.net
Fri Mar 14 15:28:59 CET 1997


On 08/03/97 at 09:41 AM, cg at ami-cg.GraySage.Edmonton.AB.CA (Chris Gray)
said:

>>Well, given an SMP machine, with an OS that will intelligently
>>distributes threads -- that all semi happens for free with me (its not
>>quite so good as I try to minimise thread creations, as few to no
>>current OS'es will migrate a thread across processors for load sharing).

>Huh? As far as I know, all SMP OS's will readily run a runnable thread on
>whatever CPU is free in the SMP. Solaris, AIX4, HPUX all do this, and I
>have no reason to believe any other wouldn't as well. Are you suggesting
>that once a thread in a process has run on a given CPU, it is somehow
>bound to that CPU for execution? If so, can you point me at some docs
>that say this - it could be quite significant for us at work.

I phrased the above incorrectly.  I'll try to clarify.

I am not aware of a MT SMP OS which will migrate an already started thread
between CPU's.  Yes, this means that once you start the thread, it is
assigned to a CPU, and there it will stay until it dies.  Note: I don't
have any supporting documentation, but I recall early docs from Cutler and
the Hursley guys mentioning this and the base reasons.

I suggest querying your MT SMP OS vendor.

The base problem with what I wrote above is that the reasoning is crap.  I
minimise thread creations because they are expensive.  What I should have
written with corrections in [squares]:

>>Well, given an SMP machine, with an OS that will intelligently
>>distributes threads -- that all semi happens for free with me (its not
>>quite so good as I try to minimise thread creations, [which] as few to no
>>current OS'es will migrate a thread across processors for load sharing,
>> [doesn't necessarily gain me much]).

I have slated at some point a touch that will preferentially kill older
threads as vs newer threads with the idea being that newer threads are
more likely to have been allocated to a currently free CPU.  Of course its
not really true, but what the heck.  I haven't thought of a better/cheaper
approach.

--
J C Lawrence                              Internet: coder at null.net
----------(*)                              Internet: coder at ibm.net
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...





More information about the mud-dev-archive mailing list