Multi-threaded Cog on Ubuntu

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Multi-threaded Cog on Ubuntu

Igor Stasenko
 
Hi, Eliot.
I just built fresh MT-enabled Cog VM on ubuntu box.
On startup it prints following messages into stdout:

sig@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?

--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: Multi-threaded Cog on Ubuntu

Eliot Miranda-2
 


On Sat, Mar 19, 2011 at 4:04 PM, Igor Stasenko <[hidden email]> wrote:

Hi, Eliot.
I just built fresh MT-enabled Cog VM on ubuntu box.
On startup it prints following messages into stdout:

sig@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.


SmalltalkImage-processHasThreadIdInstVar.st (800 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Multi-threaded Cog on Ubuntu

Igor Stasenko

Aha.. thanks ! :)

On 20 March 2011 00:44, Eliot Miranda <[hidden email]> wrote:

>
>
>
> On Sat, Mar 19, 2011 at 4:04 PM, Igor Stasenko <[hidden email]> wrote:
>>
>> Hi, Eliot.
>> I just built fresh MT-enabled Cog VM on ubuntu box.
>> On startup it prints following messages into stdout:
>>
>> sig@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.