当前位置:网站首页>本机异步网络通信执行快于同步指令
本机异步网络通信执行快于同步指令
2022-07-24 14:00:00 【墨池象牙白】
一般认为开启一个异步操作,执行起来会晚于后续的同步指令,起码晚于最近的一个同步指令
类似下面这种情况
bool isRecv = true;
byte[] data = new byte[] { 1 };
SendAsync(data);//发送
isRecv = false;
//接收
void OnRecv()
{
isRecv = true;
}
正常来说,发送数据后,isRecv=false,应该跑在OnRecv中设置isRecv=true之前。
因为是网络通信,起码经过一定的传输时间。
但是调试的时候发现,偶尔会出现 isRecv=true 先设置了,也就是说本机网络传输,速度非常快,
比执行下一个同步指令还要快,尤其这个同步指令也不是耗时操作。
有点意外哈哈哈,记录一下,以后写代码严谨一点。
边栏推荐
- FlinkTable&SQL(六)
- RHCE first operation
- After five years of contact with nearly 100 bosses, as a headhunter, I found that the secret of promotion was only four words
- 数据修改修改
- 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
- No response to NPM instruction
- 关于不定方程解的个数的问题
- On the number of solutions of indefinite equations
- 微信小程序 TODO案例
- 通配符(泛域名)SSL证书
猜你喜欢

rhcsa第六次笔记

Uni app background audio will not be played after the screen is turned off or returned to the desktop

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

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

天然气潮流计算matlab程序

Network security - file upload whitelist bypass

Network security - war backdoor deployment

5年接触近百位老板,身为猎头的我,发现升职的秘密不过4个字

Csp2021 T3 palindrome

Error importing header file to PCH
随机推荐
Remove the treasure box app with the green logo that cannot be deleted from iPhone
Flink advanced features and new features (VIII) V2
如何在Ubuntu 18.04和Debian 9上安装PHP 5.6
R language uses the sum function of epidisplay package to calculate the descriptive statistical summary information of the specified variables in dataframe under different grouping variables, visualiz
Nessus security testing tool tutorial
三层交换机配置MSTP协议详解【华为eNSP实验】
Wechat applet todo case
字符串——剑指 Offer 58 - II. 左旋转字符串
Sringboot plugin framework implements pluggable plug-in services
Network security - penetration using evil maid physical access security vulnerabilities
rhcsa第六次笔记
学习scipy minimize
Data Lake series articles
R语言检验样本比例:使用prop.test函数执行单样本比例检验计算总体中成功样本比例p值的置信区间
After five years of contact with nearly 100 bosses, as a headhunter, I found that the secret of promotion was only four words
Afnetworking data raw request mode
Stack and queue -- 232. Implement queue with stack
The solution to the error of [installation detects that the primary IP address of the system is the address assigned by DHCP] when installing Oracle10g under win7
如何在树莓派上搭建运行 WordPress
Network security -- Service Vulnerability scanning and utilization