Home > Back-end >  Java interview, ask the following questions, don't understand to know what benefits for develop
Java interview, ask the following questions, don't understand to know what benefits for develop

Time:12-10

Synchronized volatile CPU primitives is how to implement?

Unlocked, biased locking, lightweight locks, what is the difference between heavy lock?


Know his principle, I use a synchronized will improve performance

CodePudding user response:

Lock is the largest use to synchronous operation, such as you and others call this added a synchronized method at the same time, if you call first, then others will need to wait for your call to access, otherwise he is waiting for you to complete,
If you want to pull on the performance, it is worse than no, but if for the accuracy and security of the data, etc., as needed,

CodePudding user response:

Can brag to use

CodePudding user response:

General development, interviews are common

CodePudding user response:

Will not improve performance, but can make you less on the pit
  • Related