当前位置:网站首页>Native asynchronous network communication executes faster than synchronous instructions
Native asynchronous network communication executes faster than synchronous instructions
2022-07-24 14:10:00 【Ink pool Ivory】
It is generally believed that starting an asynchronous operation , The execution will be later than the subsequent synchronization instructions , At least later than the latest synchronization instruction
It's similar to the following
bool isRecv = true;
byte[] data = new byte[] { 1 };
SendAsync(data);// send out
isRecv = false;
// receive
void OnRecv()
{
isRecv = true;
}
Normally , After sending the data ,isRecv=false, Should run in OnRecv Set in isRecv=true Before .
Because it's network communication , At least after a certain transmission time .
But when debugging, I found , occasionally isRecv=true First set up , That is to say, local network transmission , Very fast ,
Faster than executing the next synchronization instruction , In particular, this synchronization instruction is not a time-consuming operation .
A little unexpected hahaha , Make a note of , Write code more strictly in the future .
边栏推荐
- How to install PHP 5.6 on Ubuntu 18.04 and Debian 9
- Network security - file upload competitive conditions bypass
- Mmdrawercontroller gets the current VC for push and pop
- Mini examination - examination system
- CSP2021 T3 回文
- After reading this article, I found that my test cases were written in garbage
- 字符串——459. 重复的子字符串
- Stack and queue - 20. Valid parentheses
- 交换
- 如何在树莓派上搭建运行 WordPress
猜你喜欢

After five years of contact with nearly 100 bosses, as a headhunter, I found that the secret of promotion was only four words

Don't lose heart. The famous research on the explosive influence of Yolo and PageRank has been rejected by the CS summit

Unity行人随机行走不碰撞

uni-app 背景音频 熄屏或者退回桌面之后不在播放

Network security - filtering bypass injection

【C语言笔记分享】——动态内存管理malloc、free、calloc、realloc、柔性数组

正则表达和绕过案例

【NLP】下一站,Embodied AI

Network security - Cookie injection

不要灰心,大名鼎鼎的YOLO、PageRank影响力爆棚的研究,曾被CS顶会拒稿
随机推荐
2.4. properties of special profile
[C language note sharing] - dynamic memory management malloc, free, calloc, realloc, flexible array
About the flicker problem caused by using universalimageloader to load pictures and refresh data in recyclerview
R语言使用sort函数排序向量数据实战、返回实际排序后的数据(默认升序)
RHCE first operation
2022.7.22 模拟赛
How to install PHP 5.6 on Ubuntu 18.04 and Debian 9
R语言使用epiDisplay包的summ函数计算dataframe中指定变量在不同分组变量下的描述性统计汇总信息并可视化有序点图、自定义cex.main参数配置标题文本字体的大小
MySQL community download address
【机器学习】之 主成分分析PCA
Network security - filtering bypass injection
C language -- program environment and preprocessing
Nmap security testing tool tutorial
自动化运维之Ansible安装部署
Centos7安装达梦单机数据库
Remove the treasure box app with the green logo that cannot be deleted from iPhone
Detailed explanation of MSTP protocol for layer 3 switch configuration [Huawei ENSP experiment]
茅台冰淇淋“逆势”走红,跨界之意却并不在“卖雪糕”
XSS white list
Notes on the use of IEEE transaction journal template