Hi all!
Here is a rather broad question: What is "CogMT" about? For whom are those multiple threads (MT)? :-)
The only build configuration I can find is build.linux64ARMv8/squeak.cogmt.spur. There is an issue with the type of sqOSSemaphore. That got me interested in the idea of CogMT ... which predates ARMv8 by a lot, right?
Best, Marcel
***
2021-07-29T11:17:34.6297654Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6305778Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6312562Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: error: conflicting types for 'sqOSSemaphore' 2021-07-29T11:17:34.6323676Z } sqOSSemaphore; 2021-07-29T11:17:34.6324255Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.6325724Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/sqMemoryAccess.h:472, 2021-07-29T11:17:34.6327528Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:35, 2021-07-29T11:17:34.6329210Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6330958Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6332629Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: note: previous declaration of 'sqOSSemaphore' was here 2021-07-29T11:17:34.6333826Z } sqOSSemaphore; 2021-07-29T11:17:34.6334219Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.9588384Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/dispdbg.h:8, 2021-07-29T11:17:34.9589908Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:19, 2021-07-29T11:17:34.9591283Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.9593124Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c: In function 'allMachineCodeObjectReferencesValid': 2021-07-29T11:17:34.9605356Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:7855:52: warning: passing argument 2 of 'mapForperformUntilarg' from incompatible pointer type [-Wincompatible-pointer-types] 2021-07-29T11:17:34.9607673Z if (!(asserta((mapForperformUntilarg(cogMethod, checkIfValidOopRefAndTargetpccogMethod, cogMethod)) == 0))) { 2021-07-29T11:17:34.9608918Z ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi Marcel,
On Jul 29, 2021, at 7:29 AM, Marcel Taeumel marcel.taeumel@hpi.de wrote:
Hi all!
Here is a rather broad question: What is "CogMT" about? For whom are those multiple threads (MT)? :-)
CogMT is the version of the CoInterpreter that implements the Threaded FFI. This is David Simmons’ implementation of the Python VM threading model where - every FFI call is non-blocking - any number of threads can run the VM but only one is running the VM at any one time - thread switches occur on FFI call out and call back, and, if one binds a Smalltalk process to a specific thread, on process switch - Smalltalk real-time scheduling semantics (preemptive across priorities, cooperative within a priority) are maintained - VM “locking” is light weight, using a single integer variable to indicate ownership and using a lock free algorithm using test-and-set instructions to acquire ownership - an FFI call “disowns” the VM by saving its id, copying the value in the vmOwner variable to a local variable and zeroing vmOwner. On return it attempts to test-and-set the vmOwner variable back to the value stashed in the local variable, which will succeed if it is still zero, entering the priority queue of threads waiting to take ownership if vmOwner is non-zero (if the VM is owned by another thread) - the heartbeat checks for a zero vmOwner and ensures a thread runs to attempt to take ownership of the VM
Hence on any FFI call the VM is released and if the call returns before the heartbeat beats, will regain ownership with the overhead of a handful of instructions and no waiting in OS semaphores or thread switches. In an FFI call on average the VM is blocked for half the heartbeat period before another thread runs the VM (currently the heartbeat is 500 Hz).
The only build configuration I can find is build.linux64ARMv8/squeak.cogmt.spur. There is an issue with the type of sqOSSemaphore. That got me interested in the idea of CogMT ... which predates ARMv8 by a lot, right?
Yes. There is a build for MacOS, but because of the GUI thread issue it crashes very soon.
I had a prototype of the Threaded FFI running in 2010. It is frustrating that I have not been able to finish this work, that the Pharo team chose to go their own way, implementing a slow heavy weight locking and thread switch mechanism similar to Pythons Global Interpreter Lock (GIL) rather than choosing to collaborate. Etc.
Best, Marcel
2021-07-29T11:17:34.6297654Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6305778Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6312562Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: error: conflicting types for 'sqOSSemaphore' 2021-07-29T11:17:34.6323676Z } sqOSSemaphore; 2021-07-29T11:17:34.6324255Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.6325724Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/sqMemoryAccess.h:472, 2021-07-29T11:17:34.6327528Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:35, 2021-07-29T11:17:34.6329210Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6330958Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6332629Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: note: previous declaration of 'sqOSSemaphore' was here 2021-07-29T11:17:34.6333826Z } sqOSSemaphore; 2021-07-29T11:17:34.6334219Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.9588384Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/dispdbg.h:8, 2021-07-29T11:17:34.9589908Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:19, 2021-07-29T11:17:34.9591283Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.9593124Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c: In function 'allMachineCodeObjectReferencesValid': 2021-07-29T11:17:34.9605356Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:7855:52: warning: passing argument 2 of 'mapForperformUntilarg' from incompatible pointer type [-Wincompatible-pointer-types] 2021-07-29T11:17:34.9607673Z if (!(asserta((mapForperformUntilarg(cogMethod, checkIfValidOopRefAndTargetpccogMethod, cogMethod)) == 0))) { 2021-07-29T11:17:34.9608918Z ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Eliot _,,,^..^,,,_ (phone)
On Jul 29, 2021, at 8:47 AM, Eliot Miranda eliot.miranda@gmail.com wrote:
Hi Marcel,
On Jul 29, 2021, at 7:29 AM, Marcel Taeumel marcel.taeumel@hpi.de wrote:
Hi all!
Here is a rather broad question: What is "CogMT" about? For whom are those multiple threads (MT)? :-)
CogMT is the version of the CoInterpreter that implements the Threaded FFI. This is David Simmons’ implementation of the Python VM threading model where
- every FFI call is non-blocking
- any number of threads can run the VM but only one is running the VM at any one time
- thread switches occur on FFI call out and call back, and, if one binds a Smalltalk process to a specific thread, on process switch
- Smalltalk real-time scheduling semantics (preemptive across priorities, cooperative within a priority) are maintained
- VM “locking” is light weight, using a single integer variable to indicate ownership and using a lock free algorithm using test-and-set instructions to acquire ownership
- an FFI call “disowns” the VM by saving its id, copying the value in the vmOwner variable to a local variable and zeroing vmOwner. On return it attempts to test-and-set the vmOwner variable back to the value stashed in the local variable, which will succeed if it is still zero, entering the priority queue of threads waiting to take ownership if vmOwner is non-zero (if the VM is owned by another thread)
- the heartbeat checks for a zero vmOwner and ensures a thread runs to attempt to take ownership of the VM
Hence on any FFI call the VM is released and if the call returns before the heartbeat beats, will regain ownership with the overhead of a handful of instructions and no waiting in OS semaphores or thread switches. In an FFI call on average the VM is blocked for half the heartbeat period before another thread runs the VM (currently the heartbeat is 500 Hz).
I meant to point you to the main implementation classes in VMMaker.oscog: CoInterpreterMT CoInterpreterMTPrimitives CogThreadManager
The only build configuration I can find is build.linux64ARMv8/squeak.cogmt.spur. There is an issue with the type of sqOSSemaphore. That got me interested in the idea of CogMT ... which predates ARMv8 by a lot, right?
Yes. There is a build for MacOS, but because of the GUI thread issue it crashes very soon.
I had a prototype of the Threaded FFI running in 2010. It is frustrating that I have not been able to finish this work, that the Pharo team chose to go their own way, implementing a slow heavy weight locking and thread switch mechanism similar to Pythons Global Interpreter Lock (GIL) rather than choosing to collaborate. Etc.
Best, Marcel
2021-07-29T11:17:34.6297654Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6305778Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6312562Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: error: conflicting types for 'sqOSSemaphore' 2021-07-29T11:17:34.6323676Z } sqOSSemaphore; 2021-07-29T11:17:34.6324255Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.6325724Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/sqMemoryAccess.h:472, 2021-07-29T11:17:34.6327528Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:35, 2021-07-29T11:17:34.6329210Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6330958Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6332629Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: note: previous declaration of 'sqOSSemaphore' was here 2021-07-29T11:17:34.6333826Z } sqOSSemaphore; 2021-07-29T11:17:34.6334219Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.9588384Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/dispdbg.h:8, 2021-07-29T11:17:34.9589908Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:19, 2021-07-29T11:17:34.9591283Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.9593124Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c: In function 'allMachineCodeObjectReferencesValid': 2021-07-29T11:17:34.9605356Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:7855:52: warning: passing argument 2 of 'mapForperformUntilarg' from incompatible pointer type [-Wincompatible-pointer-types] 2021-07-29T11:17:34.9607673Z if (!(asserta((mapForperformUntilarg(cogMethod, checkIfValidOopRefAndTargetpccogMethod, cogMethod)) == 0))) { 2021-07-29T11:17:34.9608918Z ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Eliot _,,,^..^,,,_ (phone)
On Jul 29, 2021, at 8:49 AM, Eliot Miranda eliot.miranda@gmail.com wrote:
On Jul 29, 2021, at 8:47 AM, Eliot Miranda eliot.miranda@gmail.com wrote:
Hi Marcel,
On Jul 29, 2021, at 7:29 AM, Marcel Taeumel marcel.taeumel@hpi.de wrote:
Hi all!
Here is a rather broad question: What is "CogMT" about? For whom are those multiple threads (MT)? :-)
CogMT is the version of the CoInterpreter that implements the Threaded FFI. This is David Simmons’ implementation of the Python VM threading model where
- every FFI call is non-blocking
- any number of threads can run the VM but only one is running the VM at any one time
- thread switches occur on FFI call out and call back, and, if one binds a Smalltalk process to a specific thread, on process switch
- Smalltalk real-time scheduling semantics (preemptive across priorities, cooperative within a priority) are maintained
- VM “locking” is light weight, using a single integer variable to indicate ownership and using a lock free algorithm using test-and-set instructions to acquire ownership
- an FFI call “disowns” the VM by saving its id, copying the value in the vmOwner variable to a local variable and zeroing vmOwner. On return it attempts to test-and-set the vmOwner variable back to the value stashed in the local variable, which will succeed if it is still zero, entering the priority queue of threads waiting to take ownership if vmOwner is non-zero (if the VM is owned by another thread)
- the heartbeat checks for a zero vmOwner and ensures a thread runs to attempt to take ownership of the VM
Hence on any FFI call the VM is released and if the call returns before the heartbeat beats, will regain ownership with the overhead of a handful of instructions and no waiting in OS semaphores or thread switches. In an FFI call on average the VM is blocked for half the heartbeat period before another thread runs the VM (currently the heartbeat is 500 Hz).
I meant to point you to the main implementation classes in VMMaker.oscog: CoInterpreterMT CoInterpreterMTPrimitives CogThreadManager
And point out that the interpreterProxy disownVM/ownVM pair of API functions for releasing and reacquiring the VM can also be used inside primitives, allowing us to eliminate threads in plugins, such as that inside the SocketPlugin used to achieve non-blocking name lookup.
The only build configuration I can find is build.linux64ARMv8/squeak.cogmt.spur. There is an issue with the type of sqOSSemaphore. That got me interested in the idea of CogMT ... which predates ARMv8 by a lot, right?
Yes. There is a build for MacOS, but because of the GUI thread issue it crashes very soon.
I had a prototype of the Threaded FFI running in 2010. It is frustrating that I have not been able to finish this work, that the Pharo team chose to go their own way, implementing a slow heavy weight locking and thread switch mechanism similar to Pythons Global Interpreter Lock (GIL) rather than choosing to collaborate. Etc.
Best, Marcel
2021-07-29T11:17:34.6297654Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6305778Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6312562Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: error: conflicting types for 'sqOSSemaphore' 2021-07-29T11:17:34.6323676Z } sqOSSemaphore; 2021-07-29T11:17:34.6324255Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.6325724Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/sqMemoryAccess.h:472, 2021-07-29T11:17:34.6327528Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:35, 2021-07-29T11:17:34.6329210Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6330958Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6332629Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: note: previous declaration of 'sqOSSemaphore' was here 2021-07-29T11:17:34.6333826Z } sqOSSemaphore; 2021-07-29T11:17:34.6334219Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.9588384Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/dispdbg.h:8, 2021-07-29T11:17:34.9589908Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:19, 2021-07-29T11:17:34.9591283Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.9593124Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c: In function 'allMachineCodeObjectReferencesValid': 2021-07-29T11:17:34.9605356Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:7855:52: warning: passing argument 2 of 'mapForperformUntilarg' from incompatible pointer type [-Wincompatible-pointer-types] 2021-07-29T11:17:34.9607673Z if (!(asserta((mapForperformUntilarg(cogMethod, checkIfValidOopRefAndTargetpccogMethod, cogMethod)) == 0))) { 2021-07-29T11:17:34.9608918Z ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Eliot _,,,^..^,,,_ (phone)
It's about threaded FFI implemented in the VM.
On Thu, Jul 29, 2021 at 4:29 PM Marcel Taeumel marcel.taeumel@hpi.de wrote:
Hi all!
Here is a rather broad question: What is "CogMT" about? For whom are those multiple threads (MT)? :-)
The only build configuration I can find is build.linux64ARMv8/squeak.cogmt.spur. There is an issue with the type of sqOSSemaphore. That got me interested in the idea of CogMT ... which predates ARMv8 by a lot, right?
Best, Marcel
2021-07-29T11:17:34.6297654Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6305778Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6312562Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: error: conflicting types for 'sqOSSemaphore' 2021-07-29T11:17:34.6323676Z } sqOSSemaphore; 2021-07-29T11:17:34.6324255Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.6325724Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/sqMemoryAccess.h:472, 2021-07-29T11:17:34.6327528Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:35, 2021-07-29T11:17:34.6329210Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6330958Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6332629Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: note: previous declaration of 'sqOSSemaphore' was here 2021-07-29T11:17:34.6333826Z } sqOSSemaphore; 2021-07-29T11:17:34.6334219Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.9588384Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/dispdbg.h:8, 2021-07-29T11:17:34.9589908Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:19, 2021-07-29T11:17:34.9591283Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.9593124Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c: In function 'allMachineCodeObjectReferencesValid': 2021-07-29T11:17:34.9605356Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:7855:52: warning: passing argument 2 of 'mapForperformUntilarg' from incompatible pointer type [-Wincompatible-pointer-types] 2021-07-29T11:17:34.9607673Z if (!(asserta((mapForperformUntilarg(cogMethod, checkIfValidOopRefAndTargetpccogMethod, cogMethod)) == 0))) { 2021-07-29T11:17:34.9608918Z ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For us clueless end users and application tier coders, what will we see when this is done?
A folllow up newbie question...
Squeak in morphic is, I assume, single threaded -- Test runner must run to completion before morphic events are processed-- for example.
Does this MT FFI create a possibility of two xterm based Squeeak REPLs interacting , correctly, with Cog/Spur ?
---- On Sat, 31 Jul 2021 15:13:15 -0400 bera.clement@gmail.com wrote ----
It's about threaded FFI implemented in the VM.
On Thu, Jul 29, 2021 at 4:29 PM Marcel Taeumel marcel.taeumel@hpi.de wrote:
Hi all!
Here is a rather broad question: What is "CogMT" about? For whom are those multiple threads (MT)? :-)
The only build configuration I can find is build.linux64ARMv8/squeak.cogmt.spur. There is an issue with the type of sqOSSemaphore. That got me interested in the idea of CogMT ... which predates ARMv8 by a lot, right?
Best, Marcel
***
2021-07-29T11:17:34.6297654Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6305778Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6312562Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: error: conflicting types for 'sqOSSemaphore' 2021-07-29T11:17:34.6323676Z } sqOSSemaphore; 2021-07-29T11:17:34.6324255Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.6325724Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/sqMemoryAccess.h:472, 2021-07-29T11:17:34.6327528Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:35, 2021-07-29T11:17:34.6329210Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6330958Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6332629Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: note: previous declaration of 'sqOSSemaphore' was here 2021-07-29T11:17:34.6333826Z } sqOSSemaphore; 2021-07-29T11:17:34.6334219Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.9588384Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/dispdbg.h:8, 2021-07-29T11:17:34.9589908Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:19, 2021-07-29T11:17:34.9591283Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.9593124Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c: In function 'allMachineCodeObjectReferencesValid': 2021-07-29T11:17:34.9605356Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:7855:52: warning: passing argument 2 of 'mapForperformUntilarg' from incompatible pointer type [-Wincompatible-pointer-types] 2021-07-29T11:17:34.9607673Z if (!(asserta((mapForperformUntilarg(cogMethod, checkIfValidOopRefAndTargetpccogMethod, cogMethod)) == 0))) { 2021-07-29T11:17:34.9608918Z ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
Clément Béra https://clementbera.github.io/ https://clementbera.wordpress.com/
Hi, there.
For us clueless end users and application tier coders, what will we see when this is done?
For example, you could then do a an expensive FFI call in any Squeak process other than the "UI process" in Morphic. Morphic would stay responsive. That FFI-calling process would wait on a semaphore and continue when the call returns. Just like you would design other in-image worker processes (with priorities) to keep the system responsive.
At the moment, the entire interpreter loop is blocked during that FFI call, which means that Squeak's process scheduling does not work. You will notice this even while fetching (smaller) chunks of network traffic in a low-priority process (ie., < 40) from time to time. Those little hiccups.
Best, Marcel Am 01.08.2021 23:53:05 schrieb gettimothy gettimothy@zoho.com: For us clueless end users and application tier coders, what will we see when this is done?
A folllow up newbie question...
Squeak in morphic is, I assume, single threaded -- Test runner must run to completion before morphic events are processed-- for example.
Does this MT FFI create a possibility of two xterm based Squeeak REPLs interacting , correctly, with Cog/Spur ?
---- On Sat, 31 Jul 2021 15:13:15 -0400 bera.clement@gmail.com wrote ----
It's about threaded FFI implemented in the VM.
On Thu, Jul 29, 2021 at 4:29 PM Marcel Taeumel <marcel.taeumel@hpi.de [mailto:marcel.taeumel@hpi.de]> wrote:
Hi all!
Here is a rather broad question: What is "CogMT" about? For whom are those multiple threads (MT)? :-)
The only build configuration I can find is build.linux64ARMv8/squeak.cogmt.spur. There is an issue with the type of sqOSSemaphore. That got me interested in the idea of CogMT ... which predates ARMv8 by a lot, right?
Best, Marcel
***
2021-07-29T11:17:34.6297654Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6305778Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6312562Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: error: conflicting types for 'sqOSSemaphore' 2021-07-29T11:17:34.6323676Z } sqOSSemaphore; 2021-07-29T11:17:34.6324255Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.6325724Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/sqMemoryAccess.h:472, 2021-07-29T11:17:34.6327528Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:35, 2021-07-29T11:17:34.6329210Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6330958Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6332629Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: note: previous declaration of 'sqOSSemaphore' was here 2021-07-29T11:17:34.6333826Z } sqOSSemaphore; 2021-07-29T11:17:34.6334219Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.9588384Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/dispdbg.h:8, 2021-07-29T11:17:34.9589908Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:19, 2021-07-29T11:17:34.9591283Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.9593124Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c: In function 'allMachineCodeObjectReferencesValid': 2021-07-29T11:17:34.9605356Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:7855:52: warning: passing argument 2 of 'mapForperformUntilarg' from incompatible pointer type [-Wincompatible-pointer-types] 2021-07-29T11:17:34.9607673Z if (!(asserta((mapForperformUntilarg(cogMethod, checkIfValidOopRefAndTargetpccogMethod, cogMethod)) == 0))) { 2021-07-29T11:17:34.9608918Z ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
Clément Béra https://clementbera.github.io/ [https://clementbera.github.io/] https://clementbera.wordpress.com/ [https://clementbera.wordpress.com/]
Marcel,Thank you ---- On Wed, 04 Aug 2021 09:16:24 -0400 marcel.taeumel@hpi.de wrote ---- Hi, there.> For us clueless end users and application tier coders, what will we see when this is done?For example, you could then do a an expensive FFI call in any Squeak process other than the "UI process" in Morphic. Morphic would stay responsive. That FFI-calling process would wait on a semaphore and continue when the call returns. Just like you would design other in-image worker processes (with priorities) to keep the system responsive.At the moment, the entire interpreter loop is blocked during that FFI call, which means that Squeak's process scheduling does not work. You will notice this even while fetching (smaller) chunks of network traffic in a low-priority process (ie., < 40) from time to time. Those little hiccups.Best,Marcel
Am 01.08.2021 23:53:05 schrieb gettimothy gettimothy@zoho.com:For us clueless end users and application tier coders, what will we see when this is done?A folllow up newbie question...Squeak in morphic is, I assume, single threaded -- Test runner must run to completion before morphic events are processed-- for example.Does this MT FFI create a possibility of two xterm based Squeeak REPLs interacting , correctly, with Cog/Spur ? ---- On Sat, 31 Jul 2021 15:13:15 -0400 bera.clement@gmail.com wrote ---- It's about threaded FFI implemented in the VM.On Thu, Jul 29, 2021 at 4:29 PM Marcel Taeumel marcel.taeumel@hpi.de wrote: Hi all!Here is a rather broad question: What is "CogMT" about? For whom are those multiple threads (MT)? :-)The only build configuration I can find is build.linux64ARMv8/squeak.cogmt.spur. There is an issue with the type of sqOSSemaphore. That got me interested in the idea of CogMT ... which predates ARMv8 by a lot, right?Best,Marcel*** 2021-07-29T11:17:34.6297654Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6305778Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6312562Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: error: conflicting types for 'sqOSSemaphore' 2021-07-29T11:17:34.6323676Z } sqOSSemaphore; 2021-07-29T11:17:34.6324255Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.6325724Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/sqMemoryAccess.h:472, 2021-07-29T11:17:34.6327528Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:35, 2021-07-29T11:17:34.6329210Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:16, 2021-07-29T11:17:34.6330958Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.6332629Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:75:4: note: previous declaration of 'sqOSSemaphore' was here 2021-07-29T11:17:34.6333826Z } sqOSSemaphore; 2021-07-29T11:17:34.6334219Z ^~~~~~~~~~~~~ 2021-07-29T11:17:34.9588384Z In file included from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/platforms/Cross/vm/dispdbg.h:8, 2021-07-29T11:17:34.9589908Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:19, 2021-07-29T11:17:34.9591283Z from /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogit.c:11: 2021-07-29T11:17:34.9593124Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c: In function 'allMachineCodeObjectReferencesValid': 2021-07-29T11:17:34.9605356Z /home/runner/work/opensmalltalk-vm/opensmalltalk-vm/spur64src/vm/cogitARMv8.c:7855:52: warning: passing argument 2 of 'mapForperformUntilarg' from incompatible pointer type [-Wincompatible-pointer-types] 2021-07-29T11:17:34.9607673Z if (!(asserta((mapForperformUntilarg(cogMethod, checkIfValidOopRefAndTargetpccogMethod, cogMethod)) == 0))) { 2021-07-29T11:17:34.9608918Z ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-- Clément Bérahttps://clementbera.github.io/https://clementbera.wordpress.com/
vm-dev@lists.squeakfoundation.org