[fpc-devel] Threads and alot of crap continued
Michael Schnell
mschnell at lumino.de
Wed Nov 8 12:30:06 CET 2006
> This is not an async timer in the way Vincent meant it, assuming I
> read his mails correctly. Also, pre-emptive multitasking is different
> from the async timer as you're explaining here in exactly this detail.
An asynchronous timer needs to do a preemptive callback. Preemptive
execution needs it's own thread. This is a way to provide the timer with
a thread. The advantage of this way (explicitly use a TThread instead of
having the timer create it's own thread) is (1) compatibility the timer
works like commonly known only extending the paradigm to using the timer
in a thread and (2) when using the associated thread for this objects
can manipulated without caring about mutual access with the timer
callback. If you simply want an asynchronous timer, just don't do
anything else in the associated TThread. Of course you can do a
TAsnycTimer class by using this scheme.
-Michael
More information about the fpc-devel
mailing list