[wxruby-users] Thread code questions

Alex Fenton alex at pressure.to
Mon Mar 3 15:40:44 EST 2008


Tim Ferrell wrote:
>           @worker.join(0.095) # << this is what I added
>
>   
...
> As I understand it, the limit parameter gives the Thread a certain 
> amount of time to work (in this case 95ms) before resuming the normal 
> scheduling behavior ... the end result in this case seems to be a better 
> balance between ui responsiveness and thread activity for this 
> particular app.
>   
Interesting, I've never used this parameter ebefore.
> My question: since this is my first use of Thread with wx, does anyone 
> see any potential pitfalls I may have overlooked?
>   
None that I can see. Overall I think experience with Threads + wxRuby so 
it's mainly a case of trying to see what works across platforms. Thanks 
for keeping us posted on your findings.
> 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?

cheers
alex


More information about the wxruby-users mailing list