Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4052624

Add parent thread field and accessor to Thread

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt

      Description



      Name: sgC58550 Date: 05/16/97


      currently, Thread.init() gets currentThread() and stores it to a local
      variable in order to get the "parent" thread's ThreadGroup (in some
      cases). i'd like to request that this be stored in a member field
      and that a get-accessor be added to Thread:
        public class Thread implements Runnable
        {
          ...
          private Thread parent;
          ...
          private void init(...)
          {
            parent = currentThread();
            ...
          }
        }

      generically, information is being passed from the parent thread to
      a child thread; but this information is currently limitted to the
      ThreadGroup. in my project, i extend Thread to store some per-Thread
      information. since i can't force all code (eg awt code) to use my
      special Thread, i'd like instead to be able to trace the "ancestry"
      of any given Thread; if an instance of my Thread subclass is found
      in the ancestry, i'd use that ancestor's stored information.

      this seems to me a very simple and useful addition. for example, in
      an implementation of JavaSoft's JTS, this information could be used
      to enable the default transfer of transaction context information to
      spawned threads.

      i do realize, however, this probably requires VM modifications,
      since Thread is such a low-level class.

      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            jjb Josh Bloch
            Reporter:
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: