Hi all,
just to have confirmation of what I am doing.
My app is multithreaded ; the main() loop and some other working threads,
receiving / sending data and doing calculations.
The question: what is the correct way to fire a graphics update from a thread ?
My work (omitted all sanity checks):
Me:
The question: what is the correct way to fire a graphics update from
a thread ?
Albrecht:
Others will probably chime in and tell you more about programming with
threads and FLTK.
Ian:
Ah... That quite possibly means me then...
:-)
Firstly, a caveat: Rendering to the display device
In my first app I used Fl::lock, but when the app is growing I have to
be careful not to create deadlocks, as threads can communicate with
each other.
Sure; but the Fl::lock() is a mutex, so you must only take it immediately
before you want to modify the widgets, and you release it as soon
Sure; but the Fl::lock() is a mutex, so you must only take it immediately
before you want to modify the widgets, and you release it as soon as possible.
You never hold the lock for any longer than is necessary, and you do nothing
but fltk GUI operations within the lock, so there should be no
4 matches
Mail list logo