Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Thread Timeout

Reply
Thread Tools

Thread Timeout

 
 
Francesco Vollero
Guest
Posts: n/a
 
      06-20-2010
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


 
Reply With Quote
 
 
 
 
Robert Klemme
Guest
Posts: n/a
 
      06-20-2010
On 20.06.2010 19:08, Francesco Vollero wrote:
> 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

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
 
Reply With Quote
 
 
 
 
Francesco Vollero
Guest
Posts: n/a
 
      06-21-2010
Il 20/06/10 19.50, Robert Klemme ha scritto:
> On 20.06.2010 19:08, Francesco Vollero wrote:
>> 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
>

Robert, a draft example ?

 
Reply With Quote
 
Robert Klemme
Guest
Posts: n/a
 
      06-21-2010
On 21.06.2010 02:59, Francesco Vollero wrote:
> Il 20/06/10 19.50, Robert Klemme ha scritto:
>> On 20.06.2010 19:08, Francesco Vollero wrote:
>>> 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.
>>

> 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

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread#raise, Thread#kill, and timeout.rb are unsafe Charles Oliver Nutter Ruby 43 03-25-2008 02:31 PM
Timeout::timeout and Socket timeout Mark Probert Ruby 1 10-06-2004 09:30 AM
Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300"> Carpe Diem ASP .Net 3 02-23-2004 07:10 PM
web.config session timeout and forms authentication timeout Do ASP .Net 2 11-23-2003 02:27 PM
Re: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Bob Johnson ASP .Net 0 08-07-2003 12:52 PM



Advertisments