[wxruby-users] Second thread working at slow speed

Mario Steele
2010-07-07T23:28:28Z

That''s cause whenever you pass the thread to another Ruby thread, it
takes
time away from the main thread.  And since your Processing code is in a
Secondary Thread, it gets less time then the Main Thread.

On Wed, Jul 7, 2010 at 6:42 PM, Chase Wilson <lists at ruby-forum.com>
wrote:

> I have program that does a bunch of file processing and the GUI froze up
> every time I ran it. I decided to do the trick of running my main code
> in a second thread and using the timer to update the gui every 100 ms.
> However, the problem is that the second thread that I run is working but
> very very slowly. Much slower than how it normally works.
>
> I have the timer:
>      timer = Timer.new(self,ID_ANY)
>      evt_timer(timer.id) {Thread.pass}
>      timer.start(1000)
>
> my second thread:
> newthread = Thread.new do
>        create_prompt_data
>        create_groups
>        create_xls
>      end
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>



--
Mario Steele
Lieutenant Commander 3
XO - Geo 99
XO - STO IFT Fleet
Chief Engineer - Second Life
http://www.trekfederation.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/wxruby-users/attachments/20100707/d44a6e62/attachment.html>