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
On 10-10-17 07:46 AM, Robbie M. 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
you talking crazy! =) a loop in a loop? one loop in each thread? answer
to both is yes!
–
Kind Regards,
Rajinder Y. | DevMentor.org | Do Good! ~ Share Freely
[Kubuntu x86_64 10.10 | Ruby 1.9.2p0 | Rails 3.0.1]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am 17.10.2010 13:46, schrieb Robbie M.:
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
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJMuutiAAoJEGrS0YjAWTKVZGkIAIbqH4+mIpGX3kGc0++ea0qB
LrLEd2gvw06+GJ0SvmKcvgkETK0egWZZ8WQOxsJpA4ECHatUX8mxFj9h76yvOut/
i1ZKYjS/Jfag6tAQ21pS0Uqj6ZfB3haeufZ3d0YIlY0g59kj0wxtsFrlI2NnKw8a
FbA7w85cZOqi0scI3mkyT9KFrhs0CUNY0GepoSHoehBL0DjVNzCr0d2nAFV9dYG8
CMyu96CWdXva8CsMfejW+MgyaOk+Lhyo0yEzySXjDgK0I6ShH9/91g60nVXusHuJ
fl0/3zAM4wTV4ZnbPQGP7Ni8xqjV6G8YtRkgjWJw8QdjiOuSulGvg7z4DT2eW8E=
=HzR4
-----END PGP SIGNATURE-----
On Sun, Oct 17, 2010 at 2:46 PM, Robbie M. [email protected]
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 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
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: