On 18.07.2010, at 00:12, dimatura wrote:

>> 
>> On 17.07.2010, at 23:10, dimatura wrote:
>> 
>>> I have a FLTK 1.1.x program with has two functions that manipulate a =
>> common data structure (std::vector) as well as an FLTK pack. One of the =
>> functions is invoked by an Fl::add_fd callback and the other is invoked =
>> by a Fl::add_timeout/repeat_timeout callback. Things are working fine, =
>> but I'd like to confirm that these functions are invoked serially by the =
>> event dispatch loop (Fl::run()). Is it the case?
>> 
>> Yes, that is correct. FLTK uses a single threaded approach and executes =
>> callback in an order that in this specific case may not be exactly the =
>> same as the actual event occurred (by a few microseconds).
>> 
>> FLTK *does* support multithreading through locks and awake signals, but =
>> there is always only one single GUI thread (which additionally must be =
>> the main thread of the application - a requirement by one of the =
>> underlaying platforms).
>> 
>> - Matthias=
>> 
> 
> Ok, great. Fortunately the callback functions are pretty fast so the GUI 
> remains responsive. Thanks!

Yes, pretty much everything a GUI application ever does must be done in 
callbacks or timers (or derived handle() methods). Applications that need to 
execute long calculations must either divide those into slices that run in less 
than a tenth of a second, or use threads to do their calculations 
asynchronously.

- Matthias

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to