我正在阅读一篇研究论文高性能动态无锁哈希表 和基于列表的集合(Maged M. Michael),我不理解用于示例的这种伪代码语法。
特别是这些部分:
〈pmark,cur,ptag〉: MarkPtrType;
〈cmark,next,ctag〉: MarkPtrType;
nodeˆ.〈Mark,Next〉←〈0,cur〉;
if CAS(prev,〈0,cur,ptag〉,〈0,node,ptag+1〉)
更新:
^.
似乎是一种 Pascal 符号,用于取消引用指针和访问记录中的变量 (https://stackoverflow.com/a/1814936/8524584)。←
箭头似乎是一个类似 Haskell 的do notation 赋值运算符,它将运算结果赋给一个变量。这有点奇怪,因为这篇论文比 Haskell 早将近十年。这可能是 Haskell 也借鉴的一些符号。 ( https://en.wikibooks.org/wiki/Haskell/do_notation#Translating_the_bind_operator )是向量内积的数学向量符号 (https://mathworld.wolfram.com/InnerProduct.html)
最佳答案
广角括号符号似乎是一个临时列表符号或在一行上操作多个变量(感谢@graybeard 指出)。它甚至可能是某种元组。
这就是
在类 C 语言中的样子:
MarkPtrType pmark;
MarkPtrType cur;
MarkPtrType ptag;
// or some list assignment notation
// or a tuple
^.
似乎是一种 Pascal 符号,用于取消引用指针并访问记录中的变量 (https://stackoverflow.com/a/1814936/8524584)。
关于algorithm - IBM 研究论文中的未知语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65439996/