Two while loops at once

i dont want to go into details about what im doing, i just want to know
if its possible to run 2 while loops at the same time. thanks

···

--
Posted via http://www.ruby-forum.com/.

you talking crazy! =) a loop in a loop? one loop in each thread? answer to both is yes!

···

On 10-10-17 07:46 AM, Robbie Mckennie wrote:

i dont want to go into details about what im doing, i just want to know
if its possible to run 2 while loops at the same time. thanks

--
Kind Regards,
Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely

[Kubuntu x86_64 10.10 | Ruby 1.9.2p0 | Rails 3.0.1]

t = Thread.new do
  10.times do |i|
    puts i
  end
end

10.times do
  puts "!"
end

#Wait for t to complete
t.join

Vale,
Marvin

···

Am 17.10.2010 13:46, schrieb Robbie Mckennie:

i dont want to go into details about what im doing, i just want to know
if its possible to run 2 while loops at the same time. thanks

I don't want to go into details about how to do it, I just want to let
you know it is possible.

Seriously, if you want serious help you need to give a little more
context. People can try and guess, but why? What are trying to do?
Iterate over two enumerables simultaneously? Wait for two conditions
to be met in a specific order?

Regards,
Ammar

···

On Sun, Oct 17, 2010 at 2:46 PM, Robbie Mckennie <robmckennie@msn.com> wrote:

i dont want to go into details about what im doing, i just want to know
if its possible to run 2 while loops at the same time. thanks

I've been coming across posts about iterating over multiple objects at
the same time. I can't recall but i just googled and this one came out
...

Check this out:
http://rbjl.net/32-introducing-ruby-zucker-a-new-syntactical-sugar-gem

···

--
Posted via http://www.ruby-forum.com/.