| Here's one reply I had from the FLTK people:
===================================================================
Yes, user interface related functions can only be called from the
main thread. This is a restriction of the operating systems that FLTK
builds upon. We have put a great deal of work into FLTK to still give
you access to the UI from child threads.
You ca call any function that does not open or close a window or
handle messages from a child thread. You must use correct locking to
do so:
In the main thread, you must call Fl::lock() before starting your
child threads. Do not call unlock anywhere in you main thread, FLTK
will do that for you.
In all the child threads, you must use the following sequence around
calls to FLTK:
Fl::lock();
// your FLTK calls
Fl::unlock();
Fl::awake(); // if you want the user interface to refresh changes
Remebre, don't call show() or hide() on top level or OpenGL windows
in a thread. Don't call flush(), wait() or run() either.
On Nov 30, 2005, at 10:44 AM, Victor.Lazzarini@nuim.ie wrote:
> I have been working with FLTK and Csound (FLTK 1.1.6) and
> it does not seem to be able to run in a multithreading
> environment. FLTK is built with enable-threads.
>
> Basically Fl::wait() never returns if it is called from
> a different thread than the one where FLTK library
> objects have been created.
>
> Does anyone know about this?
>
> Victor
Looks like Fl::wait() cannot be called from a thread. This is very strange
as the
code works elsewhere.
Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |