[#12443] Re: Tiny eRuby — Masatoshi SEKI <m_seki@...>
青山です。
[#12543] Ruby Conference 0.3 — greentea@...2.so-net.ne.jp (Tomoyuki Kosimizu)
こんにちは、こしみずです。
まつもと ゆきひろです
> | >18日あたり東京でRuby Conference 0.3(単なる宴会)を開きましょうか?
まつもと ゆきひろです
まつもと ゆきひろです
まつもと ゆきひろです
まつもと ゆきひろです
[#12546] [閑話] Ruby Conference 0.3 参加したいぃ — Atsuko Yoshida <atsuko@...>
こんにちは。あつこです。
松尾です。
さくです。
[#12573] alternative name of iterator — Shugo Maeda <shugo@...>
前田です。
まつもと ゆきひろです
moochan です.
まつもと ゆきひろです
moochan です.
まつもと ゆきひろです
moochan です.
まつもと ゆきひろです
moochan です.
まつもと ゆきひろです
前田です。
前田です。
わたなべです.
[#12590] kconv SJIS — Kikutani Makoto <kikutani@...>
=?ISO-2022-JP?B? ではじまるBエンコードされたサブジェクトは
Regard to "[ruby-list:12590] kconv SJIS"
On Sat, 6 Mar 1999 15:49:39 +0900,
kikutani> 出沢さんの base64_encodeモジュール最終版はどっかにありますか?
[#12623] Ruby 1.2.3 FreeBSD port — Yasuhiro Fukuma <yasuf@...>
福間@福岡 です。
[#12635] RE:UNIX USER 4/1999 — "Kozuka Masahiro" <kozuka@...>
こづかまさひろ@たきこうこうです。
[#12695] 第 2 回 OMG 分散コンピューティング・セミナー: CORBA3.0 の詳説と CORBA 活用の実際 — Junichi Suzuki <jun-sk@...>
各位.
前田です。
まつもと ゆきひろです
[#12707] Re: operater bind order ? — Inaba Hiroto <inaba@...>
稲葉です.
まつもと ゆきひろです
原です。
[#12727] Making of Interval class. — moochan <moochan@...>
moochan です.
moochan です.
昨日はRuby初心者でしたが、今日は超初心者の遠藤です。
前田です。
moochan です.
まつもと ゆきひろです
前田です。
まつもと ゆきひろです
前田です。
[#12728] Time + 1M — Wakou Aoyama <wakou@...>
青山です。
ふなばです。
五十嵐です。
ふなばです。
五十嵐です。
ふなばです。
まつもと ゆきひろです
ふなばです。
五十嵐です。
ふなばです。
[#12743] ftpmirror — Shugo Maeda <shugo@...>
前田です。
[#12756] Re: Making of Interval class. — moochan <moochan@...>
moochan です.
[#12827] ruby/tk for win32 — oshima@... (Mitsuru Oshima)
[#12835] XML developper day — Takaaki Higuchi - Technology Marketing <Takaaki.Higuchi@...>
なぜか参加してきましたので簡単に報告します。
[#12850] Ruby Conference 0.3 where ? when ? — ISII takesi <isii@...>
石井です。
まつもと ゆきひろです
松尾です。
まつもと ゆきひろです
松尾です。
まつもと ゆきひろです
松尾です。
まつもと ゆきひろです
なひです.
まつもと ゆきひろです
なひです.
まつもと ゆきひろです
なひです.
まつもと ゆきひろです
なひです.
なひです.
In message <36F0BAF925.577F.anakamur@exa.i-tech.co.jp>
In message <36F0F32B3.5781.anakamur@exa.i-tech.co.jp>
なひです.
なひです.
なひです.
なひです.
なひです.Ruby Conference #0.3以降ほったらかしてしまいました...
なひです.
わたなべです.
けいじゅ@日本ラショナルソフトウェアです.
けいじゅ@日本ラショナルソフトウェアです.
ごとけんです
まつもと ゆきひろです
ごとけんです
原です。
ごとけんです
原です。
さくです。
[#12876] Re: win32ole — 助田 雅紀 <masaki.suketa@...>
助田です.
[#12916] Thanks 出沢さん (mime.rb) — kikutani@...
快調です。ありがとうございました。
From: kikutani@sprintmail.com
出沢です
[#12918] Sieve of Eratosthenes (Re: [ruby-dev:6094]) — Shin-ichiro Hara <sinara@...>
原です。
まつもと ゆきひろです
原です。
まつもと ゆきひろです
原です。
まつもと ゆきひろです
まつもと ゆきひろです
原です。
原です。
原です。
[#12961] OS/2 support — OKUNISHI Fujikazu <fuji0924@...>
お初になります、奥西と申します。
[#12963] seqcmp.rb — sekita-n@... (Sekitani Nobutaka)
関谷@電通大です。
[#12967] profiler — "Kikutani, Makoto" <kikutani@...>
fj.comp.lang.ruby ではかわされてしまった気がする(^^)。
[#13000] Tiny eRuby — Masatoshi SEKI <m_seki@...>
[#13024] — Ryo HAYASAKA <hayasaka@...>
Subject weakref.rb exception (Re: HORB for Ruby?)
[#13063] Ruby Session in LinuxWorld Conference Japan — greentea@...2.so-net.ne.jp (Tomoyuki Kosimizu)
こんにちは、越水です。
[#13091] FAQ for /:|) — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
なひです.
[#13121] 全角文字列の分割方法について — goto@...
初めまして、後藤@横河工事(橋梁技術者)です。
まつもと ゆきひろです
後藤@横河工事(橋梁技術者)です。お世話になります。
まつもと ゆきひろです
[#13134] ロックでアドバイスをいただきたいのですが — Keisuke Minami <keisuke@...>
はじめまして。三並と申します。
松尾です。
前田です。
松尾です。
[#13140] Ruby Conference 0.3 — hisanori@...
松尾です。
ごとけんです
松尾です。
なひです.
福間%環境復旧中@福岡 です。
なひです.
なひです.僕は馬鹿だ...
[#13162] Copy array (Re: 全角文字列の分割方法について) — Inaba Hiroto <inaba@...>
稲葉です.
[#13227] blade was down — Shin-ichiro Hara <sinara@...>
原です。
[#13246] smtp でメール発送用クラス — (Dezawa Shin-ichiro) <dezawa@...>
出沢です
[#13254] hash + — Kikutani Makoto <kikutani@...>
前にもこの話題はあった気がするけど...
[ruby-list:12498] monitor.rb
前田です。 1.3用にmonitor.rbを書き直しました。 すべてのオブジェクトがインスタンス変数を持てるようになったお かげで、Rubyレベルではfinalizerの必要性はなくなったと考えて よいかもしれませんね。 Rubyではファイルなどの非メモリリソースもCレベルのfinalizerが 面倒を見てくれますし。 あと、instance_evalを使わなくてもカプセル化ができるように工 夫しました。 Mixinをアクセス指定に使う例はたぶんはじめてだと思います。 # なぜならprotectedにバグがあったから(^_^; -- 前田 修吾
Attachments (1)
=begin
monitor.rb
Author: Shugo Maeda <shugo@netlab.co.jp>
Version: 1.2
USAGE:
foo = Foo.new
foo.extend(MonitorMixin)
cond = foo.new_cond
thread1:
foo.synchronize {
...
cond.wait_until { foo.done? }
...
}
thread2:
foo.synchronize {
foo.do_something
cond.signal
}
=end
module MonitorMixin
module Accessible
protected
attr_accessor :mon_owner, :mon_count
attr_reader :mon_entering_queue, :mon_waiting_queue
end
module Initializable
protected
def mon_initialize
@mon_owner = nil
@mon_count = 0
@mon_entering_queue = []
@mon_waiting_queue = []
end
end
class ConditionVariable
include Accessible
def wait
if @monitor.mon_owner != Thread.current
raise ThreadError, "current thread not owner"
end
Thread.critical = true
count = @monitor.mon_count
@monitor.mon_count = 0
@monitor.mon_owner = nil
if @monitor.mon_waiting_queue.empty?
t = @monitor.mon_entering_queue.shift
else
t = @monitor.mon_waiting_queue.shift
end
t.wakeup if t
@waiters.push(Thread.current)
Thread.stop
Thread.critical = true
while @monitor.mon_owner != nil &&
@monitor.mon_owner != Thread.current
@monitor.mon_waiting_queue.push(Thread.current)
Thread.stop
Thread.critical = true
end
@monitor.mon_owner = Thread.current
@monitor.mon_count = count
Thread.critical = false
end
def wait_while
while yield
wait
end
end
def wait_until
until yield
wait
end
end
def signal
if @monitor.mon_owner != Thread.current
raise ThreadError, "current thread not owner"
end
Thread.critical = true
t = @waiters.shift
t.wakeup if t
Thread.critical = false
Thread.pass
end
def broadcast
if @monitor.mon_owner != Thread.current
raise ThreadError, "current thread not owner"
end
Thread.critical = true
for t in @waiters
t.wakeup
end
@waiters.clear
Thread.critical = false
Thread.pass
end
def count_waiters
return @waiters.length
end
private
def initialize(monitor)
@monitor = monitor
@waiters = []
end
end
include Accessible
include Initializable
extend Initializable
def self.extend_object(obj)
super(obj)
obj.mon_initialize
end
def try_mon_enter
result = false
Thread.critical = true
if mon_owner.nil?
self.mon_owner = Thread.current
end
if mon_owner == Thread.current
self.mon_count += 1
result = true
end
Thread.critical = false
return result
end
def mon_enter
Thread.critical = true
while mon_owner != nil && mon_owner != Thread.current
mon_entering_queue.push(Thread.current)
Thread.stop
Thread.critical = true
end
self.mon_owner = Thread.current
self.mon_count += 1
Thread.critical = false
end
def mon_exit
if mon_owner != Thread.current
raise ThreadError, "current thread not owner"
end
Thread.critical = true
self.mon_count -= 1
if mon_count == 0
self.mon_owner = nil
if mon_waiting_queue.empty?
t = mon_entering_queue.shift
else
t = mon_waiting_queue.shift
end
end
t.wakeup if t
Thread.critical = false
Thread.pass
end
def mon_synchronize
mon_enter
begin
yield
ensure
mon_exit
end
end
alias synchronize mon_synchronize
def new_cond
return ConditionVariable.new(self)
end
private
def initialize(*args)
super
mon_initialize
end
end
class Monitor
include MonitorMixin
alias try_enter try_mon_enter
alias enter mon_enter
alias exit mon_exit
alias owner mon_owner
end
# Local variables:
# mode: Ruby
# tab-width: 8
# End: