This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Types of Threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Types of Threads" Watch "Types of Threads" New topic
Author

Types of Threads

chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

I was browsing through some java websites and i stumbled upon different types of threads like worker threads, system threads .

So, in all, how many different types of threads are there?. Also, i know the thread that we create by implementing the runnable interface. Where does this thread fit in the classification?


Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

Hi,

To my knowledge there are two types of threads.

  • Daemon thread
  • Non-daemon thread


  • Cheers,
    Raj.
    Jesper de Jong
    Java Cowboy
    Saloon Keeper

    Joined: Aug 16, 2005
    Posts: 14074
        
      16

    "Worker threads", "system threads" and other kinds of threads are not really totally different kinds of threads. There isn't a fixed list of types of threads. What "type" you'd assign to a thread depends on what you are using the thread for. A thread that does work in the background you could call a "worker thread", for example.

    You can't say what type of thread a thread is that you create yourself by implementing the Runnable interface.

    Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
    Scala Notes - My blog about Scala
     
     
    subject: Types of Threads
     
    Similar Threads
    Synchronized - wait/notify/notifyall
    Different Thread Types
    Daemon Threads
    Client server program
    Spring/Apache adding thread to thread group