views:

30

answers:

0

I have a c++ application written in wxWidgets, which has a main thread (GUI) and a working thread (calculations).

The working thread executes commands requested by the main thread and communicates the result to the main thread posting an event after every step of the processing.

The problem is that when the working thread is sending many events consecutively, the gui requests made by the user (i.e. interrupt the processing clicking a button) won't be processed by the event handler until the working thread has finished.

This is actually happening on OSX, on Windows it works perfectly. I've tried to wxThread::SetPriority and wxThread::Yield but nothing changes. It is working if I put wxThread::Sleep in the working thread, but this slows down very much the processing.