Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Jul : PostMessage or Synchronize
| Subject: | PostMessage or Synchronize |
| Posted by: | "Graham Powell" (grah..@deephaven.co.uk) |
| Date: | Mon, 30 Jul 2007 11:34:56 |
I have an application running which has created a low priority thread. Every
so often the thread wants to pass a single byte of data to the main
application. Is there any difference in using PostMessage or the Synchronize
function? Both seem to work but I'm concerned there may be some thread safe
issues with PostMessage.
The problem I have is that the main application can initiate a certain
action in its own right. The thread can also request the same action is
performed by the main application. What I need to avoid is that if the main
application is in the middle of the action, the thread request will
interrupt it. I have always assumed that this is not possible as the main
apps message loop will not pick up the message until the current procedure
has finished.
One of our clients has a problem where something like this could produce the
symptoms they describe.
Any thoughts much appreciated
Graham