如何理解JSR-133发生 - 之前太弱图6/7(How to understand JSR-133 Happens-Before is too Weak Figure6/7)
在JSR-133中 ,有两个例子说明大概正确同步的程序。
第一个例子由图6给出,其中:
x == y == 0
然后,线程1通过以下方式修改状态:
r1 = x; if (r1 != 0) y = 1;
线程2通过以下方式修改状态:
r2 = y; if (r2 != 0) x = 1;
作者声明这个程序是正确同步的,但是,这个程序执行的结果是
r1 == r2 == 1
。 后者的价值甚至是可能的?此外,图7表示为初始状态:
x == y == 0
随着线程1修改:
r1 = x; y = r1;
和线程2执行:
r2 = y; x = r2;
这怎么会导致
r1 == r2 == 42
?In the JSR-133, there are two example that state presumably correctly synchronized programs.
The first example is given by figure 6 where:
x == y == 0
Then, thread 1 modifies the state by:
r1 = x; if (r1 != 0) y = 1;
and thread 2 modifies the state by:
r2 = y; if (r2 != 0) x = 1;
The author states that this program is correctly synchronized,However, there is an execution of this program that results in
r1 == r2 == 1
. How would this latter value even be possible?Furthermore, figure 7 states as an initial state:
x == y == 0
With thread 1 modifying:
r1 = x; y = r1;
and thread 2 executing:
r2 = y; x = r2;
How could this result in
r1 == r2 == 42
?
原文:https://stackoverflow.com/questions/34013636
最满意答案
你可以在
/sys/class/dmi/id
文件中找到这些信息。 这些文件是普通的文本文件,只需打开它们并阅读。 请注意,并非所有主板BIOS都会填写这些ID,但对于那些提供数据的主板,它将在那里报告。You can find this information in the files in
/sys/class/dmi/id
. These files are ordinary text files, simply open them and read. Note that not all motherboard BIOSes bother filling in these IDs, but for those mobos that do provide the data, it will be reported there.
相关问答
更多-
bios》boot》uefi disabled,然后,截图过来看看,要设置第一启动项
-
linux系统进不了bios。linux下硬盘安装windows。[2022-12-01]
bios是在主板的可读写不掉点rom中的, 和硬盘无关. 所以进不了bios, 多半是硬件有问题. 把硬盘拔了, 看看能不能进bios. 或者在别的电脑上制作一张PE启动盘, 重新分区格式化硬盘 -
安装Linux系统进入bios界面,没有cd-Rom,怎么解决[2023-10-12]
可以用U盘啊。做个PE、拷个镜像进去。然后进PE GHOST一下就OK了啊。 -
尝试使用WMI Win32_BaseBoard类 。 看这些样品: 选项1)在执行之前,您需要从Component导入Microsoft WMIScripting Library - > Import Component ,然后选择Import type library program GetWMI_MotherBoardInfo; {$APPTYPE CONSOLE} uses ActiveX, Variants, SysUtils, WbemScripting_TLB in '..\ ...
-
您可以使用WMI 一个示例函数将类似于以下源代码,我将它放在一起以获取PC的序列号,它似乎工作得非常好。 从Windows注册表中删除一个序列号然后忽略它,因为它适用于专门的环境。 # pragma comment(lib, "wbemuuid.lib") static SHORT CDeviceConfigCheckSerialNumber (TCHAR *tcsSerialNo) { HRESULT hres; IWbemLocator *pLoc = NULL; *tcsSe ...
-
您可以通过devicetime查询进行额外连接来轻微修改当前查询, devicetime为每个uniqueid标识最新的devicetime时间: SELECT d.name, d.uniqueid, d.category AS Company, p.devicetime, p.latitude, p.longitude FROM devices d INNER JOIN positions p ON d.id = p.devic ...
-
您需要使用CPUID指令。 CPUID 大多数C编译器都支持内联汇编,但是您需要知道您在做什么。 You need to use the CPUID instruction. CPUID Most C compilers have some support for inline assembly, but you will need to know what you are doing.
-
你可以在/sys/class/dmi/id文件中找到这些信息。 这些文件是普通的文本文件,只需打开它们并阅读。 请注意,并非所有主板BIOS都会填写这些ID,但对于那些提供数据的主板,它将在那里报告。 You can find this information in the files in /sys/class/dmi/id. These files are ordinary text files, simply open them and read. Note that not all motherbo ...
-
以下是Lennart Poeterring关于ID的博客文章的摘录。 它是关于唯一ID,不一定是关于安全性的唯一ID: / sys / class / dmi / id / product_uuid:主板产品UUID,由主板制造商设置并编码在BIOS DMI信息中。 它可用于识别主板和仅主板。 当用户更换主板时,它会发生变化。 此外,经常有足够的BIOS制造商在其中编写伪造的连续出版物。 此外,它是x86特定的。 禁止访问非特权用户。 因此它几乎没有用。 CPUID / EAX = 3 CPU序列号:CPU ...
-
BIOS主要以16位模式提供,而不是Linux运行的x86的32位或64位模式。 Linux进程在用户模式下运行,使用虚拟内存 ,它有自己的虚拟地址空间 。 某些机器指令(特别是用于转到BIOS的INT )具有特权,因此无法在用户模式下运行。 如果您尝试在用户模式下运行它们,则处理器会使计算机异常,内核会通过发送一些信号来处理它。 (某些INT也用于系统调用,但首选SYSENTER指令)。 应用程序使用系统调用与内核交互(可能通过VDSO )。 阅读程序集howto The INT n instructio ...