On Wednesday 30 November 2005 13:54, Victor Lazzarini wrote: > looking at widgets.cpp, it seems we are doing everything that the > FLTK designers do not allow or guarantee, when using threads. > We are calling show() and wait(). The whole design of the > thread-based code seems to be wrong. I am also wondering whether > it is possible to do what we want with the widget opcodes > in a multithreading fashion. Either we change the code or we just > scrap it. The way it is written it is not guaranteed to work. Actually, the restrictions on threading are a major problem, as Csound itself can be a plugin of some other software, and then there is no way to guarantee that it is running from the main thread. Also, even in the case of a simple command line build of Csound, it would mean that if threads are used, then the audio thread (which does not call Fl::wait() to update the GUI, that is the whole point of using two separate threads) should be the child thread, but that is quite the opposite of how Csound is designed (i.e. start audio processing in the main thread, and then optionally create widgets at a later point in time with opcode calls). So, for safety we can stick with the noFLTKThreads=1 mode, which should work (but if even that breaks on the Mac then I really do not know what to do) as long as Csound is being run in the main thread and nothing else uses FLTK in the same process. The multi-threaded code can still be used on platforms where it works, though. Perhaps we should not really use FLTK in Csound at all, but there are too many people who depend on those opcodes, however flawed they are. ------------------------------------------------------- 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