[Vm-dev] VM Maker: CogThreads-eem.1.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Oct 11 01:51:43 UTC 2021


Eliot Miranda uploaded a new version of CogThreads to project VM Maker:
http://source.squeak.org/VMMaker/CogThreads-eem.1.mcz

==================== Summary ====================

Name: CogThreads-eem.1
Author: eem
Time: 10 October 2021, 6:51:42.200606 pm
UUID: 35d06e65-6487-49c1-a014-76ef81b3ca07
Ancestors: 

Define the basic threading facilities for the threaded FFI. Provide the esserntial convenience Process>>doNotRunOnGUIThread.

==================== Snapshot ====================

----- Method: Process>>doNotRunOnGUIThread (in category '*CogThreads-thread binding') -----
doNotRunOnGUIThread
	"Arrange that the receiver will not run on the GUI thread.
	 This is useful in ensuring that the VM can stll receive events while using threaded call-outs."
	self setThreadBinding: Processor guiThreadId negated!

----- Method: Process>>getThreadBinding (in category '*CogThreads-primitives') -----
getThreadBinding
	"Answer nil or a non-zero integer that indicates the binding of the receiver to a particular thread.
	 If the result is nil, the receiver is not bound to any particular thread and free to run on any thread.
	 If the result is strictly positive, the receiver is bound to the thread with the result's numeric id, and
	 the receiver will only run on that thread.  If the result is negative then the receiver will run on any
	 thread other than the thread with the result's numeric id.
	 Hence, if the result is an integer, when the receiver becomes active a thread switch may occur,
	 and will occur if necessary to meet these two constraints."
	<primitive: 228 error: ec>
	self primitiveFailed!

----- Method: Process>>setThreadBinding: (in category '*CogThreads-primitives') -----
setThreadBinding: anIntegerOrNil
	"Set the binding of the receiver to a particular thread.
	 If anIntegerOrNil is nil, then make the receiverfree to run on any thread.
	 If anIntegerOrNil is strictly positive, then bind the receiver to the thread with id anIntegerOrNil, and
	 arrange that the receiver will only run on that thread.  If anIntegerOrNil is negative then arrange
	 that the receiver will run on any thread other than the thread with id anIntegerOrNil.
	 Hence, if the result is an integer, when the receiver becomes active a thread switch may occur,
	 and will occur if necessary to meet these two constraints."
	<primitive: 229 error: ec>
	self primitiveFailed!

----- Method: ProcessorScheduler>>currentThreadId (in category '*CogThreads-primitives') -----
currentThreadId
	<primitive: 227 error: ec>
	self primitiveFailed!

----- Method: ProcessorScheduler>>guiThreadId (in category '*CogThreads-primitives') -----
guiThreadId
	"In the VM there may be a designated thread upon which to receive events.
	 The VM guarantees that if such a thread exists it will have numeric id 1."
	^1!



More information about the Vm-dev mailing list