[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Steve Tuckner's presentation (Re: RubyConf 2003 Presentations Posted

Steve Tuckner

11/21/2003 5:32:00 PM



> -----Original Message-----
> From: David Garamond [mailto:lists@zara.6.isreserved.com]
> Sent: Friday, November 21, 2003 11:10 AM
> To: ruby-talk@ruby-lang.org
> Subject: Steve Tuckner's presentation (Re: RubyConf 2003 Presentations
> Posted)
>
>
> Ryan Davis wrote:
> > In absolute record time (5 days compared to 3 months),
> rubyconf 2003
> > presentation materials have been posted.
> >
> > They can be found at:
> >
> > http://www.zenspider.com/Languages/Ruby/RubyCon...
> >
> > I'm still waiting for some more, so check back periodically to see
> updates.
>
> Thanks a lot, Ryan.
>
> I'm interested by Steve Tuckner's "Ruby World: (Not) Implemented"
> presentation. Since I did not come to the conference, I can only view
> the slides. Judging from the title of the presentation, did the Ruby
> application project eventually fail and get unused?
>
> If true, that's sad...
>

The story behind Ruby World (Not) Implemented is that I had planned to work
on it an awful lot before the conference (I acquired a new laptop about a
month before the conference), but work priorities meant that I could spend
no time on it (literally) at all. So what I had was a half-baked
implementation that was not worth showing. I tried to back out of my talk,
but David Alan Black sent me an e-mail encouraging me to hang in there. As
luck has it however I was working on a Ruby project at work and so I made
the trials and tribulations of that the subject of my talk.

As far as RubyWorld goes, I did get a chance to work on it a fair amount at
the conference and on the drive down and up (from Mpls to Austin), and made
some good progress. It is not done enough to release to the world yet but I
may be able to release something by the end of the year.

> I'm also interested to know more about by his comment
> "Threading sucks
> up all processor time".

A simple example is as below:

require "vr/vruby"

class TestForm < VRForm
end

# Processor sucking thread
Thread.new do
while true
end
end

# Vruby code
VRLocalScreen.showForm(TestForm)
VRLocalScreen.messageloop

while true
puts "ruby"
sleep 1
end

If either the messageloop is running or after the window is closed the main
thread is running, the processor time goes up to >80%. This can have the
tendency to make systems run very sluggishly. I don't have a solution for
this yet, so any ideas would be helpful.

Steve Tuckner

1 Answer

David Garamond

11/22/2003 5:50:00 AM

0

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