Shredded interviewer series (seven): The interview is a must frequently asked interview advanced concurrent programming topics

 

Concurrent programming senior face interview questions

(Way to receive answers interview questions + See sidebar)

Synchronized related issues

  1. Synchronized used it, the principle is what?
  2. You mentioned lock acquisition target, what is this "lock" in the end? How to determine the object's lock?
  3. What is reentrancy, why Synchronized be reentrant lock?
  4. JVM for Java native lock optimized to do what?
  5. Why Synchronized non-fair locks?
  6. What is the lock and lock coarsening to eliminate?
  7. Why Synchronized is a pessimistic lock? What achieve the original optimistic locking is? What is CAS, what features it?
  8. Optimistic locking it certainly is good?

ReentrantLock reentrant locks and other problems associated explicit lock

  1. Compared with Synchronized, reentrant lock ReentrantLock implementation principle any different?
  2. So please talk about AQS framework is how it children?
  3. Compare the similarities and differences Synchronized and ReentrantLock0 under the much detail as possible.
  4. ReentrantLock is how to achieve reentrancy of?
  5. In addition to ReetrantLock, which you have come into contact with the concurrent tool JUC in?
  6. Please talk about ReadWriteLock and StampedLock.
  7. How to make Java thread synchronization with each other? You had to know what synchronizer? Please introduce respectively.
  8. CyclicBarrier and CountDownLatch look similar, please contrast of it?

Java thread pool-related issues

  1. How Java threads in the pool are implemented?
  2. Create several core configuration parameters thread pool?
  3. Thread pool thread is how to create? It is beginning with the start of the thread pool to create a good right?
  4. 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.
  5. How to submit Java threads in the thread pool?

Java Memory Model issues

  1. What is the Java memory model, Java in each thread is how to see each other's variables?
  2. Please talk about the volatile What are the characteristics and why it can ensure the visibility of the variables of all threads?
  3. Since the volatile variables between threads to ensure visibility, does that mean an operation based on volatile variable is the concurrent safe?
  4. Compare the similarities and differences of the next volatile contrast Synchronized.
  5. Please talk about how to solve the concurrent ThreadLocal is safe?
  6. Many people say should be used with caution ThreadLocal, talk about your understanding of the use of ThreadLocal what needs attention?

Guess you like

Origin www.cnblogs.com/chengxuwang/p/11207394.html