当前位置:网站首页>Instruction rearrangement concept
Instruction rearrangement concept
2022-06-24 19:32:00 【Jade label】
Instruction reordering means that the sequence of source code is different from that of program , Or the program sequence is inconsistent with the execution sequence , Reordering objects are instructions . Instruction reordering is a performance concern for the compiler , Without affecting the program ( Single threaded program ) Reorder under the condition of correctness . Instruction reordering is not inevitable , Reordering instructions can lead to thread safety problems . Instruction reordering is also called processor out of order execution , In this case, although the execution order of the instructions may not be completely in accordance with the program order , However, due to the submission of the execution result of the instruction ( To register and memory ), It's still in procedural order , Therefore, the instruction reordering of the processor will not affect the correctness of single thread . Instruction reordering does not affect the correctness of a single threaded program , But it may lead to unexpected results in multithreaded programs .
Guess execution can result in if The effect that the body of a statement is executed before its conditional statement .
Reordering is divided into instruction reordering ( compiler 、 processor ) And storage subsystem reorder ( Memory reordering , For cache , Write buffer )
Storage subsystem reordering : When the processor performs two memory access operations in strict program order , Under the action of the storage subsystem, the perceived order of these two operations by other processors may still be inconsistent with the program order , That is, the execution sequence of the two operations seems to have changed , This phenomenon is storage subsystem reordering . This is just a phenomenon, not an action , It does not really adjust the order of instruction execution , But it just causes a phenomenon that the execution order of instructions seems to have been adjusted , Its reorder object is the result of memory operation . Memory reordering can also cause thread safety problems , Like that one. s0 and s1 Write to write buffer , But the order changes ,P1 Did not read p2 The thread writes to the buffer , Reading is still old , Thread safety occurs It's all a problem .
Reordering is not disorderly, but has certain rules , Statements with data dependencies are not reordered , Only statements that do not have data dependencies are reordered . Seemingly serial , Only from a single thread point of view to ensure that the running results after reordering do not affect the correctness of the program , It does not guarantee the correctness of the program in a multithreaded environment .
边栏推荐
- How to customize cursor position in wechat applet rotation chart
- Does version 2.2.0 support dynamic addition of MySQL synchronization tables
- Apifox与其他接口开发工具的博弈
- Do you have all the basic embedded knowledge points that novices often ignore?
- At present, only CDC monitors Mysql to get the data of new columns. Sqlserver can't, can it
- Internet of things? Come and see Arduino on the cloud
- 通过SCCM SQL生成计算机上一次登录用户账户报告
- The script implements the automated deployment of raid0
- Generate the last login user account report of the computer through SCCM SQL
- Saltstack state state file configuration instance
猜你喜欢

STM32 uses time delay to realize breathing lamp register version

一文详解|Go 分布式链路追踪实现原理

Tkde2022: Dialogue recommendation system based on knowledge enhanced sampling

Camera module and hardware interface of Camera1 camera

【Go语言刷题篇】Go从0到入门4:切片的高级用法、初级复习与Map入门学习

华为机器学习服务语音识别功能,让应用绘“声”绘色

试驾 Citus 11.0 beta(官方博客)

通过SCCM SQL生成计算机上一次登录用户账户报告

Capacitive inching touch switch module control (stm32f103c8t6)

Based on STM32F103 0.96 inch OLED LCD driver (IIC communication)
随机推荐
What other data besides SHP data
8 challenges of BSS application cloud native deployment
微信小程序轮播图怎么自定义光标位置
工作6年,月薪3W,1名PM的奋斗史
SaltStack State状态文件配置实例
Capacitive inching touch switch module control (stm32f103c8t6)
Multi segment curve temperature control FB (SCL program) of PLC function block series
What are the functions of IBPs open source form designer?
Freeswitch uses origin to dialplan
AI时代生物隐私如何保护?马德里自治大学最新《生物特征识别中的隐私增强技术》综述,全面详述生物隐私增强技术
Unity mobile game performance optimization spectrum CPU time-consuming optimization divided by engine modules
Does finkcdc support sqlserver2008?
flink cdc全量读mysql老是报这个错怎么处理
R语言 4.1.0软件安装包和安装教程
Drawing DEM with GEE gracefully
cdc sql表里面的datetime要用什么类型替换
Zadig + cave Iast: let safety dissolve in continuous delivery
[R tidyverse] use of select verb
The script implements the automated deployment of raid0
Vs2017 add header file path method