[fpc-pascal] lnet for TCP daemon

Michael Schnell mschnell at lumino.de
Mon Sep 16 12:34:46 CEST 2013


On 09/16/2013 11:14 AM, Marco van de Voort wrote:
> If you mean integrate with your own eventloop, then yes, make sure 
> that your idle event in your eventloop calls checksyncrhonize

OK, so "checksynchronize()" is the correct name of the RTL-provided 
function that pulls the event queue. (Sorry that the correct name 
escaped from my silly brain.) AFAIU this supposedly is not 
platform-dependent, but simply pulls the queue and calls the event 
handlers as sub-functions of checksynchronize(). (I need to check the 
sources ASAP...)

Did I understand you correctly that there is a "notifying" procedure, 
that is called by the Event queuing mechanism each time an event is 
pushed onto the queue ? This procedure then would potentially be called 
from Worker threads and thus here, we need use the OS to schedule the 
(later to be done) queue poll by the main thread via checksynchronize(). 
Could you tell me the name of that procedure, so that I can find it in 
the sources and do a testing project using  it ?

Obviously the LCL needs to use both procedures to merge the RTL's event 
queue with the queue it handles the GUI events in.

Obviously a non-LCL based user code can implement it's own OS-depending 
mechanism to schedule a call to checksynchronize() triggered by the said 
"notifying" procedure.

The "hope" I expressed in the recent mail was, that the RTL might allow 
for enabling the described OS-depending Thread to MainThread scheduling 
mechanism, so that any user code does not need to implement it new with 
each project (but just set an enable flag or something similar). This 
should be possible as the RTL does know which OS it is built for and the 
maintainers do have the necessary expertize to do it in the optimum way.

Thanks,
-Michael





More information about the fpc-pascal mailing list