Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Threads in Java

    • 0
    • 3
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 442
    Comment on it

    Thread

    Thread is a individual program execution path. Each thread has different stack, threads share some memory space.

    Performing multiple task parallely is known as multitasking and it is achieved by developing multi threaded application.

    Process uses different memory space and context switching between process is difficult whereas context switching between threads is easy.

    Establishing communication between processes is also complex whereas establishing communication between threads is also easy.

    When we execute Java class three threads are created by JRE:

    1. Main thread
    2. Threads scheduler
    3. Garbage collection thread

    Main Thread:- It executes all the statements written in a main method. From main thread we can create our own n number of threads i.e, user defined threads.

    Threads scheduler:- It manages all the threads which are currently running and it allocates CPU time for each threads which are running currently.

    Garbage collection thread:- It manages the memory, it will kill if any abundant object exist.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: