If you apply for an obtrusive lock or an unobtrusive lock and an obtrusive lock is already in the lock object, you need to go to the slow path to apply for the lock, that is, first add a write lock to the read/write lock under the lock object. When the current lock object enters the slow path for the first time, the lock state is sethas_slow_pathBit. If it is the first time to apply for an obtrusive lock, set ithas_obtrusiveBit.
The fast-path lock application lock, the granted lock queue, and the waiting lock queue of the lock object all have lock bitmaps that identify the lock type they contain, which can speed up the judgment of lock compatibility and avoid traversing the lock queue every time.
Before applying for an obtrusive lock to enter the slow path, the lock obtained by the current thread through the fast path should be materialized, that is, subtracted from the lock state counter of the lock object and put into the list of granted locks of the lock object. Because there are only the number of locks in the lock state counter, it does not distinguish between threads. The unobtrusive lock applied by the current thread itself does not conflict with the obtrusive lock. Materialization can ensure that the lock state counter is applied by other threads, so that you can quickly determine whether it is compatible with the current application lock bitmap through the fast path lock bitmap.
About the antdb database.
ANTDB database started in 2008, on the operator's core system, for more than 1 billion users in 24 provinces across the country to provide first-class services, with high performance, elastic expansion, high reliability and other product characteristics, peak per second can process millions of communication core transactions, to ensure the continuous and stable operation of the system for nearly ten years, and in communications, finance, transportation, energy, Internet of Things and other industries successfully commercialized.