Multi Threading

What is Daemon thread and How to make Daemon thread?

What is Daemon thread and How to make Daemon thread?

What is Daemon thread and How to make Daemon thread? The threads which are executing in the background are called Demon threads. Ex… Garbage Collector, Signal Dispatcher, Attach Listener. The main objective of demon threads is to provide support for non-demon threads(main thread) For ex… If the main thread runs with low memory then JVM runs GC to destroy useless ...

Read More »

What is DeadLock and difference between DeadLock and Starvation?

What is DeadLock and difference between DeadLock and Starvation?

What is DeadLock and difference between DeadLock and Starvation? If two threads are waiting for each other forever such type of infinite waiting is called deadlock. Synchronized is the only reason for deadlock situation hence while using synchronized keyword we have to take special care. There is no resolution technique for deadlock but several prevention techniques are available. Deadlock in ...

Read More »

What is synchronization and why it is important?

What is synchronization and why is it important?

What is synchronization and why it is important? Synchronized is the modifier applicable only for methods and blocks but not for classes and variables. If multiple threads are trying to operate simultaneously on the same java object then there may be a chance of data-inconsistency problem. To overcome this problem we should go for the synchronized keyword. If a method or block declared as ...

Read More »

Difference between yield(), join(), sleep() method?

Difference between yield(), join(), sleep() method?

Difference between yield(), join(), sleep() method? We can prevent thread execution by using the following method. yield() join() sleep() public static native void yield()  yield() method causes to pause current executing thread to give the chance for waiting threads of the same priority. If there is no waiting thread or all waiting threads have low priority then the same thread ...

Read More »

Explain thread priority and what is default thread priority?

Explain thread priority and what is default thread priority?

Explain thread priority and what is default thread priority? Every thread in java has some priority. It may be default priority generated by JVM or customized priority provided by the programmer. The valid range of thread priorities is 1-10. where 1 is min priority and 10 is the max priority. Thread class defines the following constant to represent some standard ...

Read More »

What is Multi-Threading and how we can define a thread?

What is Multi-Threading and How many ways we can define a thread.

What is Multi-Threading and how we can define a thread? Executing several tasks simultaneously where each task is a separate independent part of the same program is called thread-based multitasking and each independent part is called a thread. Thread-based multitasking is best suitable at a programmatic level. Whether it is process-based or thread-base the main objective of multitasking is to ...

Read More »

Responsive WordPress Theme Freetheme wordpress magazine responsive freetheme wordpress news responsive freeWORDPRESS PLUGIN PREMIUM FREEDownload theme free