[Lazarus] nonlcl basic issue: is codetools LCL dependent?

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Jun 25 17:20:16 CEST 2014


On Wed, 25 Jun 2014 16:53:36 +0200
Michael Schnell <mschnell at lumino.de> wrote:

> On 06/25/2014 04:04 PM, Mattias Gaertner wrote:
> >
> >> Instead it then uses TThread.GetTickCount64. Do you think that is
> >> appropriate at this point in time ?
> > Yes.
> I just checked and found that with fpc vertsion 2.6.0-9, which is the 
> version I installed as a Debian Package for X86-64) TThread does not have
>   CurrentThread,
>   Queue,   and
>   GetTickCount64

AFAIK they came with 2.6.1.

 
> I do call thees three in my "interface" unit.

No problem for for the nogui widgetset.

 
> (To do a test with 64 Bit, I hence would need to install and compile the 
> svn version.)

Or use the 64bit Debian packages from Lazarus at Sourceforge.


>[...]
> > How do you support multiple timer? 
> I create a pool of timers. (My TTimer class has a class variable holding 
> all Timers created in a dynamic array.)
> When a timer tick occurs (or when CheckSynchronize returns because of a 
> queued Event), the tick count for the next tick of any timer in the pool 
> is calculated. The resulting period is used as the Timeout parameter for 
> CheckSynchronize().

ok
 
> > What scheduler do you use?
> 
> In fact none. CheckSynchronize performs the waiting in the main thread 
> and any time base that can read a current tick count (arbitrary 
> frequency) can be used as a timebase.
> 
> This Seems like requiring the lowest possible overhead (you know that 
> this is a goal of mine).
> 
> To reduce the overhead even more, my TTimer has a class property 
> "Granularity" that allows to define the accuracy of the Timers (in 
> msecs) so that with lower necessary accuracy, events of multiple TTimers 
> will occur at the same time with no system calls in between.

Nice.


Mattias




More information about the Lazarus mailing list