🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.ruby
Article #1279

wątki same się kończą

#1279
From: pawel
Date: Mon, 19 Oct 2009 22:07
19 lines
1591 bytes
Czemu w poniższym kodzie zamiast dużej ilości 'lala' na wyjściu nie
dostaje nic, a program od razu się kończy?
Przecież tam powinien chodzić nieskończony wątek i dawać jakis output
cały czas.
class Bar
  def initialize

  end
  def foo
     Thread.new do
      while true
        puts "lala\n"
      end
    end
  end
end

b=Bar.new
b.foo
Technical Details
Message-ID: <78ded556-fad5-4963-a81f-06078a37a7d4@l35g2000vba.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!l35g2000vba.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!l35g2000vba.googlegroups.com!not-for-mail
From: pawel <pjastrz@gmail.com>
Newsgroups: pl.comp.lang.ruby
Subject: wątki same się kończą
Date: Mon, 19 Oct 2009 15:07:24 -0700 (PDT)
Organization: http://groups.google.com
Lines: 20
Message-ID: <78ded556-fad5-4963-a81f-06078a37a7d4@l35g2000vba.googlegroups.com>
NNTP-Posting-Host: 83.4.185.112
Mime-Version: 1.0
X-Trace: posting.google.com 1255990044 28698 127.0.0.1 (19 Oct 2009 22:07:24 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 19 Oct 2009 22:07:24 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: l35g2000vba.googlegroups.com; posting-host=83.4.185.112;  posting-account=cdpkBAoAAADdL8-T24YNrFBma7Q66_vf
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pl; rv:1.9.1.3)  Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit