From: Eric Sven Ristad Date: 2001-03-12T13:57:38+09:00 Subject: [ruby-talk:12451] Re: Thread::parent ? Date: Mon, 12 Mar 2001 08:00:53 +0900 From: matz@zetabits.com (Yukihiro Matsumoto) Hi, In message "[ruby-talk:12382] Thread::parent ?" on 01/03/11, Eric Sven Ristad writes: |What's the cleanest way to for a thread to access it's parent (ie., |the thread that created it), other than for the parent to pass itself |as an argument to Thread.new, eg., | | t = Thread.new(Thread::current){|parent| ... } | |If there's no cleaner way, then it might be nice to define a new |Thread class method Thread::parent that does that. All threads are created equal (except the "main" thread), so that there's no such thing like parent thread. The implementation does not preserve the information of the creating thread. Do you think it's really worthy to add new slot to the internal structure to preserve this information, making things bit complex, to allow you avoid passing current thread information? No, it's not worth it then. Eric