• Principle and application from reentrantlock to AQS


    preface Java (JUC: java.util.concurrent )Among them, reentrantlock and semaphore, which are familiar to us, all use a common base class abstractqueuedsynchronizer, abbreviated as AQS. AQS is a framework for building locks and synchronizers. Using AQS can easily and efficiently construct a large number of synchronizers that are widely used, such as reentrantlock, semaphore, and others […]

  • Performance test comparison of Tomcat 7 and resin


    Recently, when testing the performance, I just compared Tomcat resin with LoadRunnerSet the JVM to 1G memory, set the maximum number of connections to 1000, and run 1000 concurrent for 5 minutes 1000 concurrent test Tomcat Bio 1000 concurrent test Tomcat NiO resin The current test results show that the performance comparison of Tomcat 7 […]

  • The system combs the lock


    background Some people have made the following comprehensive carding of Java mainstream locks. The grooming is really good. But when I see this picture, my first feeling is: I can’t remember.    Because there are too many classes, there is no connection between them. PPT is OK. If chatting or interviewing, it is not easy […]

  • Pessimistic lock optimistic lock row lock table lock shared lock exclusive lock fair lock


    preface Key words: pessimistic lock, optimistic lock, table lock, row lock, shared lock, exclusive lock, fair lock, unfair lock Pessimistic lock Every time you get data, you are worried that the data will be modified. Therefore, every time you get the data, you will lock it to ensure that the data will not be modified […]

  • Scala concurrent programming practice – 2: lock lock


    As a built-in lock, synchronized is easy to use and not easy to make mistakes. However, geese have some limitations. For example, they can’t interrupt from the block waiting to acquire the lock and can’t set the timeout of acquiring the lock.Therefore, JUC provides another more flexible locking method, namely lock. Lock The lock interface […]