David Garamond
11/22/2003 5:50:00 AM
Steve Tuckner wrote:
> # Processor sucking thread
> Thread.new do
> while true
> end
> end
What were you trying to do in that thread? The "while true; end" part is
a "busy loop" and is _supposed_ to suck CPU :)
$ ruby -e 'while true; end' ; # suck CPU
$ perl -e 'while (1) {}' ; # suck CPU
$ python -c 'while 1: pass' ; # suck CPU
If you want to give CPU time ("yield") in a thread, take a look at
Thread.stop.
--
dave