是否有任何有关可溢出数据结构的好资源或书籍,即队列?
存储大型对象时,它可能会占用所有内存,但是如果你可以在内存中保留该队列结构中最常用的项目而其余部分保留在磁盘上(有点像分页).
同样,此问题适用于其他结构,如链表,数组,哈希表等.
虽然我不确定为什么,但这似乎并不正确.建议会很棒,因为CMPXCHG16B的文档很少(我没有任何英特尔手册...)
template<>
inline bool cas(volatile types::uint128_t *src, types::uint128_t cmp, types::uint128_t with)
{
/*
Description:
The CMPXCHG16B instruction compares the 128-bit value in the RDX:RAX and RCX:RBX registers
with a 128-bit memory location. If the values are equal, the zero flag (ZF) is set,
and the RCX:RBX value is copied to the memory location.
Otherwise, the ZF flag is cleared, and the memory value is copied to RDX:RAX.
*/
uint64_t * cmpP = (uint64_t*)&cmp;
uint64_t * withP = (uint64_t*)&with;
unsigned char …Run Code Online (Sandbox Code Playgroud)