Concurrent programming senior face interview questions
(Way to receive answers interview questions + See sidebar)
Synchronized related issues
- Synchronized used it, the principle is what?
- You mentioned lock acquisition target, what is this "lock" in the end? How to determine the object's lock?
- What is reentrancy, why Synchronized be reentrant lock?
- JVM for Java native lock optimized to do what?
- Why Synchronized non-fair locks?
- What is the lock and lock coarsening to eliminate?
- Why Synchronized is a pessimistic lock? What achieve the original optimistic locking is? What is CAS, what features it?
- Optimistic locking it certainly is good?
ReentrantLock reentrant locks and other problems associated explicit lock
- Compared with Synchronized, reentrant lock ReentrantLock implementation principle any different?
- So please talk about AQS framework is how it children?
- Compare the similarities and differences Synchronized and ReentrantLock0 under the much detail as possible.
- ReentrantLock is how to achieve reentrancy of?
- In addition to ReetrantLock, which you have come into contact with the concurrent tool JUC in?
- Please talk about ReadWriteLock and StampedLock.
- How to make Java thread synchronization with each other? You had to know what synchronizer? Please introduce respectively.
- CyclicBarrier and CountDownLatch look similar, please contrast of it?
Java thread pool-related issues
- How Java threads in the pool are implemented?
- Create several core configuration parameters thread pool?
- Thread pool thread is how to create? It is beginning with the start of the thread pool to create a good right?
- As mentioned you can create a different thread pool by configuring different parameters, then the default Java thread pool to achieve good and what does? Please compare their similarities and differences.
- How to submit Java threads in the thread pool?
Java Memory Model issues
- What is the Java memory model, Java in each thread is how to see each other's variables?
- Please talk about the volatile What are the characteristics and why it can ensure the visibility of the variables of all threads?
- Since the volatile variables between threads to ensure visibility, does that mean an operation based on volatile variable is the concurrent safe?
- Compare the similarities and differences of the next volatile contrast Synchronized.
- Please talk about how to solve the concurrent ThreadLocal is safe?
- Many people say should be used with caution ThreadLocal, talk about your understanding of the use of ThreadLocal what needs attention?