[fpc-pascal] Synchronize(dummyproc) with Linux.

Sven Barth pascaldragon at googlemail.com
Thu May 2 17:15:51 CEST 2013


Am 02.05.2013 15:24 schrieb "Fred van Stappen" <fiens at hotmail.com>:
>
> > Synchronize submits a procedure for execution by the main thread, and
waits till the main thread has processed it.
>
> Ok, i understand that, but if that procedure is dummy, i do understand
why it takes a delay.

The Synchronize code can not know that the method you passed is an empty
one, so it's handled like every other method. And even if the compiler
could know that it is an empty one it could not judge what Synchronize is
doing with it (especially since Synchronize and the execution code in
CheckSynchronize is very loosely coupled). Also it is consistent that an
empty method is handled the same as a non-empty one.

And again: the delay until Synchronize returns is not only dependant on the
runtime of the method, but also on the frequency in which the main thread
calls CheckSynchronize in which the method will finally be executed.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130502/77b990d1/attachment.html>


More information about the fpc-pascal mailing list