Thread Timeout

F

Francesco Vollero

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
 
R

Robert Klemme

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,

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
 
F

Francesco Vollero

Il 20/06/10 19.50, Robert Klemme ha scritto:
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
Robert, a draft example ?
 
R

Robert Klemme

Il 20/06/10 19.50, Robert Klemme ha scritto:
Robert, a draft example ?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top