[fpc-pascal] lnet for TCP daemon

Sven Barth pascaldragon at googlemail.com
Mon Sep 16 13:56:36 CEST 2013


Am 16.09.2013 10:58, schrieb Michael Schnell:
> On 09/13/2013 07:08 PM, Sven Barth wrote:
>>
>> As we have already written in some previous mails to there is a 
>> global event procedure to wake up the main thread that is triggered 
>> when something is queued. The LCL uses this already and other 
>> programs could use a TEvent or whatever.
>>
>
> Could you elaborate on this ? Is this "triggering" done by some kind 
> of self-piping or using an OS semaphore ? Is it provided for all OSes 
> and Archs
>
> Or do you mean a function call is provided that allows the user (or 
> the LCL) to implement such a functionality.
The latter: 
http://www.freepascal.org/docs-html/rtl/classes/wakemainthread.html
It is called by the internal procedure ThreadQueueAppend which is used 
by both TThread.Queue and TThread.Synchronize. Additionally if the the 
main thread is already waiting inside a CheckSynchronize() call it is 
notified using an event.

Regads,
Sven



More information about the fpc-pascal mailing list