Re: [fpc-pascal] PostMessage() from a thread (in a thread save manner)

2008-10-20 Thread Graeme Geldenhuys
Thanks to everybody that replied... On Mon, Oct 20, 2008 at 6:43 PM, Lukas Gradl <[EMAIL PROTECTED]> wrote: > I prefer to implement the messaging in the object it belongs to - in this > case on fpgApplication. The Queue will not be visible from outside, only > funcions like PostMessage, GetMessag

Re: [fpc-pascal] PostMessage() from a thread (in a thread save manner)

2008-10-20 Thread dmitry boyarintsev
Your code is safe for multiple threads to post to the queue. But you also must make sure, that Processing a messsage from queue, would not break Posting safetiness. The easiest way, is to wrap message extraction into the same fpgApplication.Lock You must also make sure, that no thread can try to

Re: [fpc-pascal] PostMessage() from a thread (in a thread save manner)

2008-10-20 Thread Lukas Gradl
Graeme Geldenhuys schrieb: Some developers prefer to pass in a GUI component to a thread instance, so the thread knows what widget to update. Other users prefer to post a "gui update" message to the application event queue. I'm very new to threads and might know just enough to make in dangerous.

Re: [fpc-pascal] PostMessage() from a thread (in a thread save manner)

2008-10-20 Thread Vinzent Höfler
Graeme Geldenhuys wrote: Some developers prefer to pass in a GUI component to a thread instance, so the thread knows what widget to update. Other users prefer to post a "gui update" message to the application event queue. I'm very new to threads and might know just enough to make in dangerous. :

[fpc-pascal] PostMessage() from a thread (in a thread save manner)

2008-10-20 Thread Graeme Geldenhuys
Some developers prefer to pass in a GUI component to a thread instance, so the thread knows what widget to update. Other users prefer to post a "gui update" message to the application event queue. I'm very new to threads and might know just enough to make in dangerous. :-) In fpGUI the applicatio