在无锁数据结构中需要多少个ABA标签位?(How many ABA tag bits are needed in lock-free data structures?)
无锁数据结构中ABA问题的一种流行解决方案是使用额外的单调递增标签来标记指针。
struct aba { void *ptr; uint32_t tag; };
但是,这种方法有一个问题。 它非常慢,并且存在巨大的缓存问题。 如果我丢弃标签字段,我可以获得两倍的加速。 但这是不安全的?
所以我的下一个尝试64位平台的东西在ptr字段填充位。
struct aba { uintptr __ptr; }; uint32_t get_tag(struct aba aba) { return aba.__ptr >> 48U; }
但有人对我说标签只有16位是不安全的。 我的新计划是使用指针对齐到缓存行来填充更多标签位,但我想知道这是否会起作用。
如果这样做失败了,我的下一个计划是使用Linux的
MAP_32BIT
mmap
标志分配数据,所以我只需要32位指针空间。无锁数据结构中的ABA标签需要多少位?
One popular solution to the ABA problem in lock-free data structures is to tag pointers with an additional monotonically incrementing tag.
struct aba { void *ptr; uint32_t tag; };
However, this approach has a problem. It is really slow and has huge cache problems. I can obtain a speed-up of twice as much if I ditch the tag field. But this is unsafe?
So my next attempt stuff for 64 bit platforms stuffs bits in the ptr field.
struct aba { uintptr __ptr; }; uint32_t get_tag(struct aba aba) { return aba.__ptr >> 48U; }
But someone said to me that only 16 bits for the tag is unsafe. My new plan is to use pointer alignment to cache-lines to stuff more tag bits in but I want to know if that'll work.
If that fails to work my next plan is to use Linux's
MAP_32BIT
mmap
flag to allocated data so I only need 32 bits of pointer space.How many bits do I need for the ABA tag in lock-free data-structures?
原文:https://stackoverflow.com/questions/42514565
最满意答案
我不熟悉intel xdx,但版本代码通常是这样的数字:
versionCode:
11
在这种情况下,versionName可能是
1.1
。因此使用
11
代替1.1
可能会有所帮助。I'm not familiar with intel xdx, but the version code is usually a number like:
versionCode:
11
The versionName could be
1.1
in that case.So using
11
instead of1.1
might help.
相关问答
更多-
我不熟悉intel xdx,但版本代码通常是这样的数字: versionCode: 11 在这种情况下,versionName可能是1.1 。 因此使用11代替1.1可能会有所帮助。 I'm not familiar with intel xdx, but the version code is usually a number like: versionCode: 11 The versionName could be 1.1 in that case. So using 11 instead of 1. ...
-
英特尔XDK中的HTTP请求(HTTP requests in Intel XDK)[2023-08-14]
关于通过模拟器引用的相对位置URL存在回归错误,正在进行修复。 这仅与模拟器有关。 使用设备上的App Preview并使用构建,您的应用程序应该可以正常使用测试选项卡。 There is a regression bug with regards to relative location URL referenced through emulator, a fix is being worked on. This is related to emulator only. Your app should w ... -
Intel XDK / Cordova onDeviceReady事件不会触发(Intel XDK/Cordova onDeviceReady event does not fire)[2021-12-22]
也许这样的事情可以解决它。 interval = setInterval(function(){ if(intel){ //your block code inside the onDeviceReady() clearInterval(interval); } },200); 将在200ms间隔内调用间隔内的此代码,直到定义对象“intel”。 Ok the problem was indeed in ... -
英特尔XDK + Phonegap(Intel XDK + Phonegap)[2022-09-15]
是的,如果我正确理解了这个问题,我相信你可以使用英特尔XDK在一个应用程序中访问这两个API。 Yes, if I understand the question correctly, I believe you can access both API's in a single app using Intel XDK. -
该错误意味着您的data变量未定义。 data变量未定义,因为object.get(1)与对象库中的任何对象都不匹配。 The error means your data variable is undefined. The data variable is undefined because object.get(1) did not match any objects in your object store.
-
此问题仅在版本为3.0及更高版本的Android设备上才会出现。 随着Android Web浏览器和WebView的渲染引擎更改为Webkit,intel.xdk.startShoutcast()无法成功执行,因为它是对浏览器引擎的内部修改。 This issue is only seen on Android devices with version 3.0 and above. With the change of the Android web browser and WebView's render ...
-
什么是使用intel xdk从我的应用程序打开链接的工作代码(What is working code for opening a link from my app using intel xdk)[2024-03-31]
我推荐使用 var url = "http://google.com"; window.open(url, '_system'); 在Android和iOS平台上测试过。 或者,您也可以使用Cordova的InappBrowser插件。 I recommend using var url = "http://google.com"; window.open(url, '_system'); Tested on Android and iOS platforms. Alternatively yo ... -
此版本的App Analyz不支持INTEL XDK API(INTEL XDK API is Not Supported by This version Of App Analyz)[2022-08-25]
调试和性能分析在当前的英特尔XDK中处于测试阶段,因此它不支持任何intel.xdk API,它仅支持Cordova API。 您必须从应用中删除所有intel.xdk.* API调用和intelxdk.js脚本。 The Debug and Profiling is in beta in the current Intel XDK, so it does not support any intel.xdk APIs, it only supports Cordova APIs. You will have ... -
创建一组新的配置文件和证书。 这通常可以解决问题。 Create a new set of provisioning files and certs. That will generally fix the problem.
-
从“模拟”选项卡中,启动模拟器并打开调试控制台(使用“模拟”选项卡工具栏上的“错误”图标)。 键入top.process.versions ,您将获得一个包含XDK中重要子系统版本的对象。 XDK构建于node-webkit之上。 例如,在3759版本的XDK中,您将看到一个如下所示的对象: JavaScript top.process.versions Object {http_parser: "2.3", node: "0.12.7", v8: "3.28.71.19", uv: "1.6.1", zl ...