... Top of Stack Control Word 栈顶控制字 top of stack,TOS 堆栈顶 top of stack control word,TOSCW 堆栈顶控制字 ...
基于6个网页-相关网页
这样,即使线程b在线程A试图弹出数据的同时修改了堆栈顶,也可以确保不会跳过堆栈中的元素。
With this arrangement, even if Thread B has modified the top while Thread a tries to pop, you're sure that no elements in the stack are skipped.
堆栈的顶存储在 result 中,使用 CAS 把 top 位置更新为 top->next 并返回适当的数据。
The top of the stack is stored in result, and you use CAS to update the top location with top-<next and return the appropriate data.
push方法观察当前最顶的节点,构建一个新节点放在堆栈上,然后,如果最顶端的节点在初始观察之后没有变化,那么就安装新节点。
The push method observes the current top node, constructs a new node to be pushed on the stack, and then, if the topmost node has not changed since the initial observation, installs the new node.
应用推荐