Eliot Miranda uploaded a new version of Kernel to project The Trunk: http://source.squeak.org/trunk/Kernel-eem.1523.mcz
==================== Summary ====================
Name: Kernel-eem.1523 Author: eem Time: 22 August 2023, 12:55:52.155147 pm UUID: a4d61d2f-cc75-4b8c-9615-cef127a2b3fd Ancestors: Kernel-ct.1522
Rename Process's threadId inst var to threadAffinity while we still can. This is in response to Leon Matthes correctly pointing out that the variable is an affinity, not an id. Thanks!
=============== Diff against Kernel-ct.1522 ===============
Item was changed: Link subclass: #Process + instanceVariableNames: 'suspendedContext priority myList threadAffinity effectiveProcess name island env' - instanceVariableNames: 'suspendedContext priority myList threadId effectiveProcess name island env' classVariableNames: '' poolDictionaries: '' category: 'Kernel-Processes'!
+ !Process commentStamp: 'eem 8/22/2023 12:52' prior: 0! - !Process commentStamp: 'eem 10/9/2021 15:34' prior: 0! I represent an independent path of control in the system. This path of control may be stopped (by sending the message suspend) in such a way that it can later be restarted (by sending the message resume). When any one of several paths of control can be advanced, the single instance of ProcessorScheduler named Processor determines which one will actually be advanced, partly using the value of priority.
Instance Variables: N.B. The first four are used by the virtual machine. They must be defined, and defined in this order, suspendedContext: <Context|nil> priority: <Integer> myList: <LinkedList|nil> + threadAffinity: <Integer|nil> - threadId: <Integer|nil> effectiveProcess: <Process|nil> name: <String|nil> island: <Island|nil> env: <Dictionary|nil>
effectiveProcess - if not nil effectiveProcess is a process I am running on behalf of. Used by the execution simulation machinery (used by the debugger) to ensure that Processor activeProcess et al answer the expected result when simulating execution (e.g. when debugging). See evaluate:onBehalfOf: and senders.
env - if not nil this is a Dictionary providing process-specific variables. See e.g. environmentAt:*, DynamicVariable and ProcessSpecificVariable.
island - used by Tweak and Croquet to partition the image into multiple address spaces
myList - if nil, I am either suspended or the active process. If not nil it is either some condition variable (Semaphore, Mutex) that I am blocked waiting on, or it is the LinkedList in ProcessorScheduler quiescentProcesses that holds the processes for my priority that are not the current active process but still runnable.
name - if not nil this is my name, used for information, see e.g. the names of processes displayed in the ProcessBrowser
priority - my scheduling priority, which corresponds to the index in ProcessorScheduler quiescentProcesses that holds the LinkedList of processes at this priority. If I am running but quiescent, changing priority involves changing priority and myList.
suspendedContext - if nil, then I am either the active process or I have been terminated. If not nil it is the Context at the hot end of my stack
+ threadAffinity + - if not nil then it is an integer value set by the VM that controls how I interact with underlying native threads. If positive, the threadAffinity is that of some native thread known to the VM, and the VM will ensure that when I am running, I will be running on that native thread. If negative, the absolute value of threadAffinity is that of some thread known to the VM, and the VM will ensure that when I am running, I will *not* be running on that native thread. Set by the VM. Not to be set manually. Meaningful only on threaded VMs (which do not mean VMs with a threaded heartbeat). It is required to be my fourth instance variable. See SmalltalkImage >> #processHasThreadAffinityInstVar: for further information.! - threadId - - if not nil then it is an integer value set by the VM that controls how I interact with underlying native threads. If positive, the threadId is that of some native thread known to the VM, and the VM will ensure that when I am running, I will be running on that native thread. If negative, the absolute value of threadId is that of some thread known to the VM, and the VM will ensure that when I am running, I will *not* be running on that native thread. Set by the VM. Not to be set manually. Meaningful only on threaded VMs (which do not mean VMs with a threaded heartbeat). It is required to be my fourth instance variable. See SmalltalkImage >> #processHasThreadIdInstVar: for further information.!
Item was changed: + (PackageInfo named: 'Kernel') postscript: '"Make sure the 4th inst var of Process is threadAffinity, not threadId" - (PackageInfo named: 'Kernel') postscript: '"Turn on the enableIPv6 preference for trunk."
+ (Process instVarNames at: 4) = ''threadId'' ifTrue: + [Process instVarNames at: 4 put: ''threadAffinity'' copy]'! - NetNameResolver enableIPv6: true. - '!
Hi Eliot,
Item was changed:
- (PackageInfo named: 'Kernel') postscript: '"Make sure the 4th inst var of Process is threadAffinity, not threadId"
- (PackageInfo named: 'Kernel') postscript: '"Turn on the enableIPv6 preference for trunk."
- (Process instVarNames at: 4) = ''threadId'' ifTrue:
- [Process instVarNames at: 4 put: ''threadAffinity'' copy]'!
- NetNameResolver enableIPv6: true.
- '!
out of curiosity: what is this #copy for? Do instanceVariables have to be writable? :-)
Best, Christoph
--- Sent from Squeak Inbox Talk
On 2023-08-22T19:56:27+00:00, commits@source.squeak.org wrote:
Eliot Miranda uploaded a new version of Kernel to project The Trunk: http://source.squeak.org/trunk/Kernel-eem.1523.mcz
==================== Summary ====================
Name: Kernel-eem.1523 Author: eem Time: 22 August 2023, 12:55:52.155147 pm UUID: a4d61d2f-cc75-4b8c-9615-cef127a2b3fd Ancestors: Kernel-ct.1522
Rename Process's threadId inst var to threadAffinity while we still can. This is in response to Leon Matthes correctly pointing out that the variable is an affinity, not an id. Thanks!
=============== Diff against Kernel-ct.1522 ===============
Item was changed: Link subclass: #Process
- instanceVariableNames: 'suspendedContext priority myList threadAffinity effectiveProcess name island env'
- instanceVariableNames: 'suspendedContext priority myList threadId effectiveProcess name island env' classVariableNames: '' poolDictionaries: '' category: 'Kernel-Processes'!
- !Process commentStamp: 'eem 8/22/2023 12:52' prior: 0!
!Process commentStamp: 'eem 10/9/2021 15:34' prior: 0! I represent an independent path of control in the system. This path of control may be stopped (by sending the message suspend) in such a way that it can later be restarted (by sending the message resume). When any one of several paths of control can be advanced, the single instance of ProcessorScheduler named Processor determines which one will actually be advanced, partly using the value of priority.
Instance Variables: N.B. The first four are used by the virtual machine. They must be defined, and defined in this order, suspendedContext: <Context|nil> priority: <Integer> myList: <LinkedList|nil>
- threadAffinity: <Integer|nil>
threadId: <Integer|nil> effectiveProcess: <Process|nil> name: <String|nil> island: <Island|nil> env: <Dictionary|nil>
effectiveProcess
- if not nil effectiveProcess is a process I am running on behalf of. Used by the execution simulation machinery (used by the debugger) to ensure that Processor activeProcess et al answer the expected result when simulating execution (e.g. when debugging). See evaluate:onBehalfOf: and senders.
env
- if not nil this is a Dictionary providing process-specific variables. See e.g. environmentAt:*, DynamicVariable and ProcessSpecificVariable.
island
- used by Tweak and Croquet to partition the image into multiple address spaces
myList
- if nil, I am either suspended or the active process. If not nil it is either some condition variable (Semaphore, Mutex) that I am blocked waiting on, or it is the LinkedList in ProcessorScheduler quiescentProcesses that holds the processes for my priority that are not the current active process but still runnable.
name
- if not nil this is my name, used for information, see e.g. the names of processes displayed in the ProcessBrowser
priority
- my scheduling priority, which corresponds to the index in ProcessorScheduler quiescentProcesses that holds the LinkedList of processes at this priority. If I am running but quiescent, changing priority involves changing priority and myList.
suspendedContext
- if nil, then I am either the active process or I have been terminated. If not nil it is the Context at the hot end of my stack
- threadAffinity
- if not nil then it is an integer value set by the VM that controls how I interact with underlying native threads. If positive, the threadAffinity is that of some native thread known to the VM, and the VM will ensure that when I am running, I will be running on that native thread. If negative, the absolute value of threadAffinity is that of some thread known to the VM, and the VM will ensure that when I am running, I will *not* be running on that native thread. Set by the VM. Not to be set manually. Meaningful only on threaded VMs (which do not mean VMs with a threaded heartbeat). It is required to be my fourth instance variable. See SmalltalkImage >> #processHasThreadAffinityInstVar: for further information.!
- threadId
- if not nil then it is an integer value set by the VM that controls how I interact with underlying native threads. If positive, the threadId is that of some native thread known to the VM, and the VM will ensure that when I am running, I will be running on that native thread. If negative, the absolute value of threadId is that of some thread known to the VM, and the VM will ensure that when I am running, I will *not* be running on that native thread. Set by the VM. Not to be set manually. Meaningful only on threaded VMs (which do not mean VMs with a threaded heartbeat). It is required to be my fourth instance variable. See SmalltalkImage >> #processHasThreadIdInstVar: for further information.!
Item was changed:
- (PackageInfo named: 'Kernel') postscript: '"Make sure the 4th inst var of Process is threadAffinity, not threadId"
- (PackageInfo named: 'Kernel') postscript: '"Turn on the enableIPv6 preference for trunk."
- (Process instVarNames at: 4) = ''threadId'' ifTrue:
- [Process instVarNames at: 4 put: ''threadAffinity'' copy]'!
- NetNameResolver enableIPv6: true.
- '!
squeak-dev@lists.squeakfoundation.org