Thread reference in Hashtable

Posted on 2012-08-20
Last Modified: 2012-08-20
What effect if any is there on a reference to a running thread held in a Hashtable, should the thread no longer be running?
Question by:krakatoa
    1 Comment
    LVL 16

    Accepted Solution

    A reference to a Thread is just that: a reference. Whether the Thread runs or not is not connected to where the reference is held; an array, a variable, or a hash table. The reference merely provides data which are a means to controlling, or obtaining information about, the Thread by calling methods of the Thread class.

    So it makes no difference, conceptually, whether the Thread is running or not.
    Now the details of your program may or may not impose some kind of constraint. But that is the more specific situation.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
    This video teaches viewers about errors in exception handling.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now