On 07/11/11 15:00, David wrote: > However, I did also mention that maybe using XInitThreads and XLockDisplay > and XUnlockDisplay would allow FLTK to support opening windows in multiple > threads????? maybe someday I can lean more about X and look at making it able > to open multiple windows in different threads, but I got FLTK about where it > is needed for me to complete the linux app. I'd like to see those > improvements implemented before too many changes occur, especially the one > that just moves data that was all in a .H file to two files .cxx and .H. So I have to mention that there's no guarantee what I'm saying is *right*, but, the issue with using GUI windows in the non "main" thread is something like follows: http://stackoverflow.com/questions/6178618/mac-os-x-is-it-possible-to-imbue-a-non-main-thread-to-become-the-main-thread
Now, this is only one very specific example where someone has attempted to make the "non main" thread the main GUI thread, however hopefully this illustrates the points that have been made so far. There is no guarantee whatsoever that any of the libraries we support are able to manage threading as you want them to do. Now, as it turns out, your X server might work absolutely perfectly -- great! -- but this may also be different from X version to X version. One other point that Albrecht has illustrated is that different windowing systems also handle their updates in different ways. This makes it incredibly difficult to do cross-platform GUI threading because you're not guaranteed when what thread does what, or which thread fires first, or etc. across different platforms. I think perhaps the point you've been missing is that while it is certainly *possible* to have the non-main thread do GUI work, the fact remains that it is in no way portable and is incredibly volatile. This is mostly what precludes this from being used in/added into FLTK - since people often aim for cross-platform portability the behaviour you've found on your machine doesn't necessarily apply to all machines. Of course, if the app is only for your personal use then it's up to you what you do with it; if it runs on your X server then you're by no means forced to not use it. Regards, Ben _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk