Win a copy of Java Challengers this week in the Java in General forum!
    Bookmark Topic Watch Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Other FAQ pages

  • ThreadPools
  • ExtendingThreadVsImplementingRunnable
  • WaitAndNotifyInObjectClass
  • ThreadLister - code to list all currently active threads in a JVM


  • Articles

  • Introduction to ThreadLocal


  • Notable books

  • Java Concurrency in Practice by Brian Goetz et al.
  • Java Threads by Henry Wong and Scott Oaks



  • What is multithreading?

    A thread is a lightweight process which when spawned creates parallel paths of execution. It is somewhat similar to multitasking, but whereas tasks are heavyweight processes, threads are lightweight processes that are often part of a task. Java has support for thread-based multitasking. Threads in Java can be broadly classified in two types: user threads and daemon threads. A user thread is what you get by default - the thread that calls the main() method is a user thread. The distinction between user and daemon thread is only to determine whether a program has completed -- the JVM will exit when there are only daemon threads running. A thread can be made Daemon by calling the setDaemon(<boolean>) method. But this call should be made before calling the start() method otherwise a JavaDoc:java.lang.IllegalThreadStateException will be thrown.


    CategoryFaq
     
    You showed up just in time for the waffles! And this tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
      Bookmark Topic Watch Topic
    • New Topic