[Lazarus] nonlcl basic issue: is codetools LCL dependent?

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri Jun 27 03:19:15 CEST 2014


Michael Schnell schrieb:

> TThread.Queue in the end calls WakeMainThread() to wake the main thread 
> (i.e. terminate the CheckSynchronize call waiting for a timeout).

In Simula a single time base is used to trigger events at a known time. 
Each event, to occur after a given delay, is enterd into a queue, sorted 
by the absolute time of the event. Every clock tick increments the 
internal clock, and triggers all events waiting for the time just 
reached. For periodic events the event handler enters itself into the 
queue again, for the next event time. When the next time is calculated 
from the time of the previous event, incremented by the time period, 
jitter or delays in event processing are eliminated.

Event handlers in the main loop can be invoked immediately, for handlers 
in other threads the thread is suspended when it waits for an event, and 
is resumed when the time has been reached. This way a thread also can 
wait for multiple events, it only has to fork to the handler associated 
with the just signaled event.

DoDi





More information about the Lazarus mailing list