[wxruby-users] Thread code questions

Tim Ferrell lists at ruby-forum.com
Wed Mar 5 12:47:49 EST 2008


Tim Ferrell wrote:
> 
> Downloads are much faster for me this way... they do  still feel a 
> little bit throttled but overall it feels like a better balance so I am 
> happy for now... although I may try adjusting the timer/limit to smaller 
> increments and see how that affects ui responsiveness and download 
> speeds... :-)

Well, if it helps anyone else, I discovered that setting the join limit 
too low caused crashes, at least on the Mac... I ended up using 10ms 
monitor interval and a 50ms join limit... I also had to remove the check 
of @dialog.canceled from within the thread as this occasionally led to 
malloc double free errors. Now the monitor_queue method just kills the 
thread if the user requests to cancel...

> 
> Well, maybe I'm off the mark here but I was thinking that the Timer 
> would fire the monitor-queue method call every 100ms regardless of the 
> status of the joined thread and that, as such, it might end up calling 
> the method while a previous invocation was still active... 
> 

This concern proved to be unfounded as joining the thread inhibits the 
timer from firing until the thread releases the join...

Thanks to everyone for all the help with this!!

Cheers,
Tim
-- 
Posted via http://www.ruby-forum.com/.


More information about the wxruby-users mailing list