这些最小尺寸比大部分人期望的大许多——它们可能导致巨大的浪费,例如,在分配许多小链表节点的应用程序中。
These minimum sizes are larger than most people would like to see — they can lead to significant wastage for example in applications allocating many tiny linked-list nodes.
例如,一个链表在指针为4字节的系统上可能分配只包含两个指针的节点,也就是说只需要8个字节。
For example, a linked list on a system with 4-byte Pointers might allocate nodes holding only, say, two Pointers, requiring only 8 bytes.
在两个级别上执行锁定(见清单7):链表有一个读写锁,各个节点包含一个互斥锁。
Locking occurs on two levels (see Listing 7) : The list has a read-write lock, while individual nodes contain a mutex.
应用推荐