[fpc-pascal] Main thread wait and CheckSynchronize

Brad Campbell brad at wasp.net.au
Mon May 17 16:00:27 CEST 2010


Michael Van Canneyt wrote:
> 
> Hello,
> 
> I think that what you did is the only right solution. Synchronizing
> threads is tricky, and the default mechanism is meant for GUI apps where 
> the main thread is the GUI thread.
> 

I wish there was a way for a thread to asynchronously notify the main thread there is a 
Synchronize() pending. On Linux I can insert an fd() for a pipe into the gtk event loop and poke 
data into the pipe from the thread. It's incredibly efficient and saves all the waiting and polling. 
I've not worked out how to do this on OSX or Win32 yet though.

Brad
-- 
Dolphins are so intelligent that within a few weeks they can
train Americans to stand at the edge of the pool and throw them
fish.



More information about the fpc-pascal mailing list