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

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

                                          
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to