Am 02.05.2013 15:24 schrieb "Fred van Stappen" <fi...@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
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal