# Ruby/Tk 100% CPU problem maybe fixed

**URL:** <https://rubytalk.org/t/ruby-tk-100-cpu-problem-maybe-fixed/6304>\
**Category:** ruby-talk\
**Created:** [9 June 2003 18:29 UTC](https://rubytalk.org/t/ruby-tk-100-cpu-problem-maybe-fixed/6304 "2003-06-09T18:29:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hidetoshi\_NAGAI](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://rubytalk.org/u/Hidetoshi_NAGAI)\
**Post date:** [9 June 2003 18:29 UTC](https://rubytalk.org/t/ruby-tk-100-cpu-problem-maybe-fixed/6304/1 "2003-06-09T18:29:53Z")

</div>

Hi,

I renewed Tk.mainloop. It may have no 100% CPU problem.  
Please get it from CVS and check whether it has proper  
timer values or not.

# You may be able to replace Ruby/Tk on Ruby1.6.8 by it.

# If you want, please try at your own risk.

> **···**
>
> –  
> Hidetoshi Nagai ([nagai@ai.kyutech.ac.jp](mailto:nagai@ai.kyutech.ac.jp))

---

<div class="post-metadata">

**Author:** ![daniel11](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@daniel11](https://rubytalk.org/u/daniel11)\
**Post date:** [9 June 2003 21:21 UTC](https://rubytalk.org/t/ruby-tk-100-cpu-problem-maybe-fixed/6304/2 "2003-06-09T21:21:45Z")

</div>

Hidetoshi NAGAI wrote:

> Hi,
> 
> I renewed Tk.mainloop. It may have no 100% CPU problem.  
> Please get it from CVS and check whether it has proper  
> timer values or not.
> 
> # You may be able to replace Ruby/Tk on Ruby1.6.8 by it.
> 
> # If you want, please try at your own risk.

under win32 there is also a thread with  
priority “highest” - really ugly,…

daniel

---

<div class="post-metadata">

**Author:** ![Hidetoshi\_NAGAI](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://rubytalk.org/u/Hidetoshi_NAGAI)\
**Post date:** [10 June 2003 01:19 UTC](https://rubytalk.org/t/ruby-tk-100-cpu-problem-maybe-fixed/6304/3 "2003-06-10T01:19:08Z")

</div>

Thank you for your report.

> **···**
>
> From: daniel [offstuff@aon.at](mailto:offstuff@aon.at)  
> Subject: Re: Ruby/Tk 100% CPU problem maybe fixed  
> Date: Tue, 10 Jun 2003 06:21:45 +0900  
> Message-ID: [3ee4f4c4$0$22264$91cee783@newsreader02.highway.telekom.at](mailto:3ee4f4c4$0$22264$91cee783@newsreader02.highway.telekom.at)
> 
> > under win32 there is also a thread with  
> > priority “highest” - really ugly,…
> 
> ## win32… I don’t have a test environment for win32-ruby. Could you tell me details of your ruby environment? If your ruby is running on only one thread (main thread) and the thread is Tk.mainloop, the cost of such process is almost equal to the cost of Tcl/Tk. (I think so.) Is Tcl/Tk running under lower priority? Even if you change parameters on tcltklib.c (line 72–77; especially DEFAULT\_NO\_EVENT\_WATI on line 74 and NO\_THREAD\_INTERRUPT\_TIME on line 77), do you get the same result?
> 
> ```
> Hidetoshi Nagai (nagai@ai.kyutech.ac.jp)
> 
> ```
