From: Hidetoshi NAGAI Date: 2010-02-21T15:21:16+09:00 Subject: Re: Tk on Windows and Mac OS X 10.6 From: mdiam Subject: Re: Tk on Windows and Mac OS X 10.6 Date: Sat, 20 Feb 2010 19:16:41 +0900 Message-ID: > The FFI ffi-tk ruby project should work with any plateform > (e.g. jruby but also macruby, etc...). > But if Hidetoshi hasn't choose that way (i.e. ffi) for tk, > propably there is a good reason (like the threads, or simply > it much more work ?) Because I'm not familiar with FFI, I don't have good ideas to soleve complexity of combination of callbacks, threads, and exceptions. For example ... The eventloop is running on thread1. thread2 calls Tk function1 (send to thread1; serialized on event queue). thread1 get thread2's request from the event queue. thread1 call callback1 on Ruby. callback1 (running on thread1) calls Tk function2. function2 call callback2 on Ruby. And, an exception is raised in callback2. Then, how should we treat the exception? Tcl/Tk functions know nothing about Ruby threads. Of course, there are some methods to solve it. However, those methods may have other problems; slow operation or response (with lock process), depend on global variables, explosion of entry tables, CPU power eater (by busy loop), and so on. To solve or avoid all of them on Ruby only may be difficult. # I agree that ffi-tk is valuable even if it has some restrictions. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)