sqInt ioSetInputSemaphore(sqInt semaIndex)


Parms:
sqInt semaIndex positive number which is the external index number for the squeak semaphore to signal

return: NONE, fake return of zero
but can set successFlag to make primitive fail.

From: Interpreter
Why:
Why: to set the event driven UI input semaphore

Responsibility:
Track the input semaphore for signalling. Although this was added to the VM in the early days of the event driven VM changes it was not exploited by most platforms for semaphore signalling. The feeling was that because the VM was signal threaded and Morphic was polling every 1/60 why signal the semaphore? However the fact the semaphore was setup altered the basic processing of most VMs to place events into a circular FIFO event queue versus placing in a static area for later polling.

Note in conjunction with ioProcessEvents we would record the state of the mouse for polling, and place keystrokes in a FIFO circular buffer for later retrieval.

MacIntosh
os-9/OSXCarbon
We attempt to signal this semaphore on input event processing. Earlier carbon VM, pre MacIntel ran Squeak as a worker thread, and the carbon event queue was another thread, so it was multi-threaded. We also used the fact if this was non-zero to ensure the polling state for ioPeekKeystroke, ioGetKeystroke, ioMousePoint, ioGetButtonState was correctly which was:
kEventRawKeyModifiersChanged create a kEventMouseMoved event

if semaIndex is zero record keystrokes or the fake wheel mouse move events into the old keyBuf circular queue

Cocoa:
See iPhone

iPhone
This is signalled when a touch event is turned into a compiex event. Same for acceleration, and location events.

Unix

Windows
Does not signal the semaphore, uses it to build new events, versus using older static variables, and queues

BUGS
Some implementations do not signal the semaphore so the squeak event loop logic must poll.


There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki