[Vm-dev] Multi-threaded Cog on Ubuntu

Igor Stasenko siguctua at gmail.com
Sat Mar 19 23:47:59 UTC 2011


Aha.. thanks ! :)

On 20 March 2011 00:44, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>
>
>
> On Sat, Mar 19, 2011 at 4:04 PM, Igor Stasenko <siguctua at gmail.com> wrote:
>>
>> Hi, Eliot.
>> I just built fresh MT-enabled Cog VM on ubuntu box.
>> On startup it prints following messages into stdout:
>>
>> sig at sig-VirtualBox:~/vmbuild/build/results$ ./Cog
>> ~/macHome/projects/pharo/Pharo-1.3/Cog-Tester.image
>> warning, processHasThreadId flag is unset; cannot function as a
>> threaded VM if so.
>> warning: Process doesn't have threadId; VM will not thread
>> warning: Process doesn't have threadId; VM will not thread
>> warning: Process doesn't have threadId; VM will not thread
>> warning: Process doesn't have threadId; VM will not thread
>> warning: Process doesn't have threadId; VM will not thread
>> warning: Process doesn't have threadId; VM will not thread
>> warning: Process doesn't have threadId; VM will not thread
>> warning: Process doesn't have threadId; VM will not thread
>> warning: Process doesn't have threadId; VM will not thread
>> warning: Process doesn't have threadId; VM will not thread
>>
>>
>> Is there everything fine, or something got wrong?
>
> This is fine.  To enable threading you have to modify the Process class definition to include threadId as its fourth inst var and tell the VM of that fact by setting a bit in the image via vmParameterAt: (the below, also attached).
> Link subclass: #Process
> instanceVariableNames: 'suspendedContext priority myList threadId errorHandler name island env'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'Kernel-Processes'!
> SmalltalkImage methods for system attributes
> processHasThreadIdInstVar: aBoolean
> "The threaded VM needs to know if the 4th inst var of Process
> is threadId which it uses to control process-to-thread binding.
> This flag persists across snapshots, stored in the image header."
> aBoolean ifTrue: [self assert: (Process instVarNames at: 4) ='threadId'].
> self vmParameterAt: 48 put: ((self vmParameterAt: 48) bitClear: 1) + (aBoolean ifTrue: [1] ifFalse: [0])
> e.g.
> "Ensure VM knows whether Process has threadId inst var or not."
> Smalltalk processHasThreadIdInstVar: (Process instVarNames includes: 'threadId').
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list