From: Leslie Viljoen Date: 2006-05-11T04:48:24+09:00 Subject: Slowing threads Hi! I have written a program that simulates three "consoles" that accept keyboard input and run concurrently. You can type commands which each run at different speeds without interfering with other commands. It works but it's complex and I think it can be simpler if I have each command run in it's own thread - at the moment I don't use threads at all. So I have been creating threads to test and playing with priorities. I'd like to be able to control the speed at which processes run but if I set a thread to just one priority higher than another, it is scheduled tens of thousands of times more often. So: 1. What do the priorities actually mean? 2. If I have to slow one thread just a little, that means messy sleep() commands on every second line. Is there a way I can call just parts of a passed-in block? ie. can I do something similar to this: def sleeper(&block) block.each_command do |c| eval(c) sleep(0.5) end end sleeper do puts "one" puts "two" puts "three" end If it's too much magic I'll just intersperse with sleep, just thought there might be a better way.