Documente Academic
Documente Profesional
Documente Cultură
Strictfp:(Strict Floating Point): for each and every OS the precision of a floating
value may vary from platform to platform.
Multithreading:
Multiprocessing:
Multiple Process executed simultaneously
1) New
2) runnable
3) Running
4) Non-Runnable
5) Terminate
Creating a thread
Preemtive Scheduling: the high priority thread will go into execution and complete
the task, if another higher priority thread comes in a queue then the first thread
will be in waiting state and other thread will go into execution and so on.
Time Slicing:
In this each and every thread get one time if that thread complete the task in that
time which is assigned then it will enter into terminate state otherwise that
thread will come again in a queue.
Join():
join() work on the thread and it give priority to the thread for complete their
task.
Join() work until that thread will enter into terminate state.
in other word it causes the other thread to be in waiting state until the join
thread complete the task.
Naming a Thread:
1) setName()
2) getName()
CurrentThread:
CurrentThread().
It is a low priority thread and used to perform the background supporting task for
the user.
Its life depend on user thread.
If there is no user thread then JVM will delete the Daemon thread.
Example : finalize() and gc() is a daemon thread.
Difference between wait and sleep method?
Sleep() : sleep the thread for a specific time if tht time over thread will the
resource and complete the work.
wait(): the thread will be in waiting state until the next thread call notify();