-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
thanks a lot for your work on the great programming language !!!
just tried the new 1.8.0 preview and all my sample programms run just fine.
is there a list somewhere where I can find all the changes from version
1.6.x to 1.8 ??
Yea, I’ve seen/reported this behavior as well. Apparently the person working
on the ruby Tk is redoing some of the code.
I’ve had to ‘jump’ to using FXRuby.
Kurt
···
On Tuesday 24 December 2002 08:01 pm, Kero van Gelder wrote:
Ruby/Tk uses 100% CPU (as reported for a preview)
worse, when using Tk 8.4, I don’t see any window (works with Tk 8.3)
I know. But I don’t have enough time and any idea to fix this problem.
Of course, if use old Tk.mainloop, Ruby/Tk doesn’t use 100% CPU,
though some Ruby/Tk script will hang up. For example, some cases of
following situation makes Ruby/Tk hanging up.
First, Tk calls Ruby (e.g. event callback).
Then the event loop waits for Ruby operation.
The called Ruby calls Tk (e.g. treat Tk widget) and
waits for finishing Tk operation.
But to finish the Tk operation, the event loop must be running.
Current Tk.mainloop starts a watch-dog thread. If the event loop is
sleeping, the watch-dog thread starts new event loop.
The old Tk.mainloop uses a timer for thread switching. Even if no Tk
operations which waiting for proceeding, Ruby/Tk waits the time for
thread switching.
The current Tk.mainloop uses Tcl_DoOneEvent function with TCL_DONT_WAIT.
So, if no event is waiting, Ruby can do thread switching quickly.
But if no other thread is running, the cost of Tcl_DoOneEvent loop may be
unreasonable.
I think one solution is to use Tcl_SetNotifier to hook into Tcl’s event
system. You could then get Tcl to use rb_thread_select() instead of
select().
Paul
···
On Wed, Dec 25, 2002 at 03:58:19PM +0900, nagai@ai.kyutech.ac.jp wrote:
The current Tk.mainloop uses Tcl_DoOneEvent function with TCL_DONT_WAIT.
So, if no event is waiting, Ruby can do thread switching quickly.
But if no other thread is running, the cost of Tcl_DoOneEvent loop may be
unreasonable.
I think one solution is to use Tcl_SetNotifier to hook into Tcl’s event
system. You could then get Tcl to use rb_thread_select() instead of
select().
Thank you for your advice. But, unfortunately, We’ll not be able to use
Tcl_SetNotifier. Current Ruby/Tk supports Tcl7.4 +, and the function was
added on Tcl8.2 +. (Am I right?)
Of course, I can use the function for Tcl8.2+ only. But, on Tcl7.4 - 8.1,
the problem is still left and we need other solutions.
Although we may stop supporting Tcl7.x, we’ll not be able to stop
supporting Tcl8.0 - 8.1. For example, some (Japanese) Linux distributions
still use Tcl/Tk8.0jp (Japanese version) because of better Japanese
support.
If we edit source code of Tcl/Tk, probably it is easy to fix the problem.
But it will not be allowed.