Locking occurs on two levels (see Listing 7) : The list has a read-write lock, while individual nodes contain a mutex.
在两个级别上执行锁定(见清单7):链表有一个读写锁,各个节点包含一个互斥锁。
The mutex API provides five functions: three are used for locking, one for unlocking, and another for testing a mutex.
互斥锁api提供了5个函数:其中3个用于锁定,一个用于解锁,另一个用于测试互斥锁。
To help minimize mutex allocation and locking time, the JVM manages a global lock cache and a per-thread lock cache where each cache contains unallocated pthread_mutexes.
为了帮助实现互斥锁分配和锁定时间的最小化,JVM管理一个全局锁缓存和一个单线程锁缓存,其中每个缓存包含了未分配的 pthread_mutex。
After locking that, it creates a new thread and increments threadcount; after it's done, it unlocks the mutex.
之后它创建一个新的线程同时增量threadcount;在完成之后,它解锁互斥量。
After locking that, it creates a new thread and increments threadcount; after it's done, it unlocks the mutex.
之后它创建一个新的线程同时增量threadcount;在完成之后,它解锁互斥量。
应用推荐