Thread Timeout
by Francesco Vollero » Tue, 22 Jun 2010 02:08:05 GMT
Hi list,
i'm working with multiple threads, with a producer-consumer like algorithm.
My problem is that i want that the "consumer" thread take all the
content every *N* seconds and after go to "sleep" again, It's the
Timeout library a good solution? I can use Ruby 1.9 and 1.8 as well.
Thanks,
Francesco Vollero
Re: Thread Timeout
by Robert Klemme » Tue, 22 Jun 2010 02:49:27 GMT
Why do you want to do that? If you want to schedule activity with
particular intervals then I believe a scheduling solution would be
better. In a simplistic solution you can have the main thread sleep for
the interval and create a thread for each task.
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://www.**--****.com/
Re: Thread Timeout
by Francesco Vollero » Tue, 22 Jun 2010 09:59:15 GMT
Il 20/06/10 19.50, Robert Klemme ha scritto:
Robert, a draft example ?
Re: Thread Timeout
by Robert Klemme » Wed, 23 Jun 2010 01:45:16 GMT
You go first. ;-) You did not yet describe what kind of problem you are
trying to solve.
Btw, sleeping and starting threads isn't that hard.
Cheers
robert
--
remember.guy do |as, often| as.you_can - without end
http://www.**--****.com/