[fpc-pascal] lnet for TCP daemon
Sven Barth
pascaldragon at googlemail.com
Wed Sep 18 09:53:39 CEST 2013
On 18.09.2013 09:32, Michael Schnell wrote:
> - TTimer is implemented including defining the timeout constant for
> calls to CheckSynchronize() as the greatest common denominator of the
> "Time" property of all enabled TTimer instances in the project (i.e. a
> simple timer that accumulates delays imposed by MainThread activities)
I wouldn't use the timeout constant for this. If you have two timers of
which the greatest common denominator is 1, but nevertheless rather
large (e.g. two primes) then you'd loop unnecessarily (I know this is a
constructed example, but nevertheless one should care for this!). I'd
instead suggest to implement the timerloop of each timer as a thread
that waits its timeout time on a event (so that it can also be stopped)
and then notifies the mainthread using Queue().
Regards,
Sven
More information about the fpc-pascal
mailing list