From: ara.t.howard@... Date: 2007-02-16T15:55:38+09:00 Subject: Thread.current.parent and Thread.current.ancestors can anyone see issues with this: harp:~ > cat a.rb class Thread class << self alias_method "__new__", "new" def new *a, &b parent = Thread.current __new__(*a) do |*a| Thread.current.parent = parent b.call *a end end end def parent self['parent'] end def parent= parent self['parent'] = parent end def ancestors list = [t = self] while((t = t.parent)) list << t end list end end Thread.new{ Thread.new{ Thread.new{ sleep 2; p Thread.current.ancestors } } } STDIN.gets harp:~ > ruby a.rb [#, #, #, #] it's hard to wrap my head around, but even GC seems like it'd be fine - the child, upon death, will allow the parent to be freed, and so on. -a -- we can deny everything, except that we have the possibility of being better. simply reflect on that. - the dalai lama