[wxruby-users] Thread code questions
Tim Ferrell
lists at ruby-forum.com
Mon Mar 3 15:57:55 EST 2008
Alex Fenton wrote:
> Interesting, I've never used this parameter ebefore.
Me either :-) It does seem to work, though, joining for the amount of
time specified... This gave me a little more flexibility to time things
in such a way that the ui generally stays responsive while still letting
the download thread have some undivided time to work...
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... :-)
>> Would there be any harm in wrapping the Thread.join call with some kind
>> of flag to tell monitor_queue to skip over its normal processing if the
>> worker thread is currently joined?
>>
> Not that I can see. I'm not sure it would ever reach that point - would
> the main thread start running again until the limit expires?
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... I may be
overthinking it though! I have not yet had much exposure to Ruby's
threads... :-)
Cheers,
Tim
--
Posted via http://www.ruby-forum.com/.
More information about the wxruby-users
mailing list