[Lazarus] Some questions about thread timing and syncrhonization

Frank Church vfclists at gmail.com
Mon Jul 12 16:26:06 CEST 2010


The code is running in a TProcess executing command prompt programs rather
than from an API, and I thought the issue of waiting for the result makes it
better if they are run in threads.

My preferred approach is that even if the thread is suspended during the
Synchronize period, it should remain suspended until a timer running in the
main thread kicks it of again. I think testing the thread's *while not
terminated* loop to see if it is time yet is an inefficent use of resources

On 12 July 2010 14:26, Michael Schnell <mschnell at lumino.de> wrote:

>  On 07/12/2010 02:27 PM, Frank Church wrote
>
>  I want the thread to be activated only a certain number of times every few
>> minutes
>>
> Maybe you better use a TTimer callback event instead of a thread. The
> purpose of (worker-)threads is to do (fast) work in the background.
>
>
> -Michael
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
Frank Church

=======================
http://devblog.brahmancreations.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20100712/56b7c7b8/attachment-0004.html>


More information about the Lazarus mailing list