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

Fred van Stappen fiens at hotmail.com
Thu May 2 18:20:15 CEST 2013

> > 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.



Yep, Sven, that is a clear explanation.
Now, ok, i catch it.
Many thanks. ( and i gonna finally sleep good this night ). ;)

PS : Im a totally FPC-addicted and i like that ;).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130502/794ad242/attachment.html>

More information about the fpc-pascal mailing list