- Introduction
- Defining a Thread in java by extending Thread class.(7 special case)
- Defining a Thread in java using Runnable Interface
- Defining a Thread in java using Callable and collecting in FutureTask
- Naming of Thread, Getting and setting name of thread
- Thread priorities
- The methods to prevent Thread execution(Yield/Join/Sleep/Interrupt)
- Interrupt a sleeping,waiting thread.
- Thread Synchronization (synchronized method)
- Synchronized block
- Inter thread communication (wait/notify/notifyAll)
- What is Thread Safety in Java
- Deadlock
- Demon Threads
- Green Thread stop(), suspend() and resume()
- Thread life cycle in java
- Thread Group
- Lock Interface of java.util.concurrent package
- ReentrantLock Class
- Reentrant ReadWriteLock
- Executor Framework
- Thread pools (Executor Framework)
- Callable and Future
- Thread local
- Fork and Join Framework
- CountDownLatch
- CyclicBarrier
- Volatile in Java
- Atomic in Java. Examples of Atomic in Java
- Transient in Java
- Exchanger (Refer Jenkov)
- Semaphore (Refer Jenkov)
Referece :
- Advance MultiThreading – Jekov (Follow the menu on right)
- Advance Concurrency Innerworking in detail – jenko (Follow the menu on right)
Future Topics
- When to write a threadsafe code using vector?
- Transient, Volatile and Atomic Variables
- Concurrent Collections in java
- Stack size in Thread
- Producer Consumer Problem and Race Condition
Interview Questions :
- What are the benefits of using Multithreading?
- What is Thread in Java?
- What are the two ways of implementing thread in Java?
- What’s the difference between thread and process?
- What’s the difference between class lock and object lock?
- How many ways we can set a Thread name ?
- What’s the difference between User thread and Daemon thread?
- How can we create daemon threads? Example
- What are the wait() and sleep() methods?
- What’s the difference between notify() and notifyAll()?
- Why wait(), notify(), and notifyAll() methods are present in Object class?
- What is Runnable and Callable Interface? Write the difference between them.
- What is the start() and run() method of Thread class?
- Explain thread pool?
- What’s the purpose of the join() method?
- What do you mean by garbage collection?
- Explain the meaning of the deadlock and when it can occur?
- Explain volatile variables in Java?
- How do threads communicate with each other?
- Can two threads execute two methods (static and non-static concurrently)?
- What is the purpose of the finalize() method?
- What is the synchronization process? Why use it?
- What is synchronized method and synchronized block? Which one should be preferred?
- What is thread starvation?
- What is Livelock? What happens when it occurs?
- What is BlockingQueue?
- Can you start a thread twice?
- Explain context switching.
- What is CyclicBarrier and CountDownLatch?
- What do you mean by inter-thread communication?
- What is Thread Scheduler and Time Slicing?
- What is a shutdown hook?
- What is busy spinning?
- What is ConcurrentHashMap and Hashtable? In java, why is ConcurrentHashMap considered faster than Hashtable?
- Explain thread priority.
- What do you mean by the ThreadLocal variable in Java?
- What is semaphore?
- Explain Thread Group. Why should we not use it?
- What is the ExecutorService interface?
- What will happen if we don’t override the thread class run() method?
- What is the lock interface? Why is it better to use a lock interface rather than a synchronized block.?
- Is it possible to call the run() method directly to start a new thread?
- Is it possible that each thread can have its stack in multithreaded programming?
Reference :
- interviewbit (MCQs included)
- javatpoint
- journaldev
- javarevisited
- java2blog
- baeldung
- indeed
- indeed2
- javahungry
- youtube
Study Material from YoutubePlayList