[fpc-pascal] getting started with threads
jonas.maebe at elis.ugent.be
Fri Sep 18 23:19:16 CEST 2009
On 18 Sep 2009, at 23:04, Dariusz Mazur wrote:
> But is this optimal solution:
> procedure SysThreadSwitch;
> WinThreadManager.ThreadSwitch :=@SysThreadSwitch;
> procedure ThreadSwitch;
> We have 2 unnecessary invoke function. Can compiler optimize this?
> Or maybe better do ThreadSwitch and SysThreadSwitch inlined.
SysThreadSwitch cannot be inlined, because it's called as a procvar.
And since you are doing a context switch anyway, the additional
overhead of a direct and an indirect call is negligible.
More information about the fpc-pascal