CallbackMessage->post() huge delays?


Still ongoing difficulties here with some threading mistake I’m making and unable to track… which is resulting in weird effects.

I assume I’m somehow causing the MessageManager lock some issues but I just can’t see how this works - because SOME post() statements are dramatically delayed while other ones go off instantly.

I’m using exactly the same code to create callback messages and post() each time - and I have a print statement that goes off before anything else.

From the print statements, I can see that I post a couple of dozen CallbackMessages - but that the messages are not executed.

Nothing happens for a while. I have a job that goes off every 30 seconds, posting a short CallbackMessage, and that goes off fine. Then about a minute later, all the original CallbackMessages all suddenly execute together.

If I were holding the lock somewhere, then that other message wouldn’t be able to be delivered, right?

Other symptoms involve my menus popping up and never popping down. Again, seems like the lock must be held, but other parts of the UI are being updated inside CallbackMessages…

I’ll let you know if I find a solution first!


Weird stuff. If you can put together a test app that reproduces it, I’ll take a look for you…


Oh, thanks, I’m not at that stage of desperation! Yet… :smiley:

I generally post obscure issues like this, if only to clear my mind, but also so that there’s a common record for the next guy. I have had a lot of success searching through the forums before…

I found two bugs. One was textually small but massively major bug I’d introduced a day or so ago - my callback registerer was calling back on the thread that did the registration under some circumstances.

So it seems like the main thread was CPU-starved… which sorta doesn’t make sense but does more or less describe what was going on.

There was another interesting trap I’d fallen into which I’ll be posting on the still-open thread about, er, threading best practices.