[fpc-pascal] Main thread wait and CheckSynchronize

Roland Schaefer roland.schaefer at fu-berlin.de
Sun May 16 15:50:28 CEST 2010


Allow me to bump this. I'd appreciate any comments, even if it's "Why on
earth do you want to do that!?" or something.

Thanks
Roland

On 14.05.2010 00:18, Roland Schaefer wrote:
> Hello,
> 
> I have a seemingly simple question which nevertheless is giving me
> headaches: I have a main thread which does nothing but [1] execute
> CheckSynchronize, then [2] check whether some other things have to be
> done as a result of the synchronization (and do those things if
> necessary), then go back to [1] (until some quit condition is met).
> 
> Now, instead of busy waiting in the main thread loop (even with a Sleep
> inserted), I'd rather have it idle wait until another thread needs to
> synchronize. Is that possible?
> 
> I have tested a solution which achieves what I want (main thread waits
> until some other thread wakes it) with a TEventObject, but that requires
> threads to explicitly post a specific event and breaks support for
> threads which simply expect CheckSynchronize to be called regularly.
> 
> I'd really appreciate any hints on this.
> 
> Cheers
> Roland
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> 



More information about the fpc-pascal mailing list