当前位置:网站首页>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 .
边栏推荐
- 对话框管理器第二章:创建框架窗口
- Soft link, hard link
- Where can Huatai Securities open an account? Is it safe to use a mobile phone
- Data type binary string type
- Network security - Cookie injection
- 栈与队列——225. 用队列实现栈
- Learn science minimize
- 天然气潮流计算matlab程序
- R语言使用epiDisplay包的tableStack函数制作统计汇总表格(基于目标变量分组的描述性统计、假设检验等)、设置by参数为目标变量、设置percent参数配置是否显示百分比信息
- Uni app background audio will not be played after the screen is turned off or returned to the desktop
猜你喜欢

Nmap安全测试工具使用教程

北京一卡通以35288.8529万元挂牌出让68.45%股权,溢价率为84%

After reading this article, I found that my test cases were written in garbage

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

Network security - Cookie injection

Error importing header file to PCH

Network security - error injection

How to quickly wrap lines in Excel table

JS execution mechanism
![[untitled] rhcsa first operation](/img/ba/6b9c11edbc18ffb52f6046360b5b10.png)
[untitled] rhcsa first operation
随机推荐
Network security - filtering bypass injection
Introduction to the separation of front and rear platforms of predecessors
uni-app 背景音频 熄屏或者退回桌面之后不在播放
[oauth2] III. interpretation of oauth2 configuration
本机异步网络通信执行快于同步指令
threw exception [Circular view path [index]: would dispatch back to the current handler URL [/index]
How to install PHP 5.6 on Ubuntu 18.04 and Debian 9
Detailed analysis of common command modules of ansible service
Noip2021 T2 series
SQL server startup and shutdown job script
在EXCEL表格中如何进行快速换行
Network security - file upload competitive conditions bypass
Flink comprehensive case (IX)
Error importing header file to PCH
Centos7安装达梦单机数据库
Flink advanced features and new features (VIII)
The fourth edition of Zhejiang University probability proves that the uncorrelation of normal distribution random variables is equivalent to independence
Csp2021 T1 corridor bridge distribution
The KAP function of epidisplay package in R language calculates the value of kappa statistics (total consistency, expected consistency), analyzes the consistency of the results of multiple scoring obj
自动化运维之Ansible安装部署