Threading concept is very important in Java Programing language. A thread is a sequential path of code execution within a program. And each thread has its own local variables, program counter and lifetime.
Overview of Thread
Threading concept is very important
in Java Programing language. A thread is a sequential path of code execution
within a program. And each thread has its own local variables, program counter
of A Thread Life Cycle of Thread contains different states - New state, Runnable,
Running state, Dead state, Non-Runnable state.
Thread can be implementing by one of two ways - Extending
the java.lang.Thread Class, Implementing
the java.lang.Runnable Interface.
constructors are available for creating new Thread instances like Thread()
to Multithreading Multithreading is a technique that allows a
program or a process to execute many tasks concurrently (at the same time
and parallel). It allows a process to run its tasks in parallel mode on a
single processor system.
of Multiple Threads Like creation of a single thread, You can also create
more than one thread (multithreads) in a program using class Thread or implementing
Priorities and Scheduler In Java, thread scheduler can use the thread priorities
in the form of integer value to each of its thread to
determine the execution schedule of threads . Thread gets the ready-to-run state
according to their priorities.
A situation where a thread is waiting for an object lock that holds by second thread, and this second thread is waiting for an object lock that holds by first thread, this situation is known as Deadlock.
Lock and Synchronized Threads Java uses monitor also
known as ?semaphore? to prevent data from being corrupted by multiple
threads by a keyword synchronized to synchronize them
and intercommunicate to each other. Lock term refers to the access granted to
a particular thread that can access the shared resources.
Communication A process
where, a thread is paused while running in its critical region and another
thread is allowed to enter (or lock) in the same critical section to be
executed. This technique is known as Inter-Thread communication
Daemon threads are service providers for other threads or objects running in the same process as the daemon thread. Daemon threads are used for background supporting tasks and are only needed while normal threads are
Thread Synchronization in Java
When two or more threads need shared resource, they need a proper mechanism to ensure that the resource will be used by only one thread at a
time. The mechanism we use to achieve this is known as thread synchronization.
October 7, 2011
I am very intrested in java language
November 12, 2011
I want a deep information about Reflection in Java.
What is Use of Reflection ?
How can we Use Reflection ?
January 19, 2012
March 21, 2012
need more information
May 16, 2012
java support multiple inhertance? if yus then asked me......
July 13, 2012
I got good understading of the java concepts...
December 17, 2012
All point is easily explain on this site.
November 20, 2012
java is very difficult for me.how shall i understand java?
January 4, 2013
it is not saiisfy
December 27, 2013
Copying a large file using threads in Java
I want to copy a large file using a few threads, I want to compare the time to copy a file to a thread by copying the same files with multi-threading.
I want write this program with java.
please guide me.