当前位置:网站首页>2、 Concurrent and test notes youth training camp notes
2、 Concurrent and test notes youth training camp notes
2022-07-07 07:24:00 【A low-key horse】
Concurrent 、 Unit test course notes | Youth Camp notes
This is my participation 「 The third youth training camp - Back end field 」 The third part of note creation activities 1 Notes
Concurrent
Concurrency and parallelism
Concurrent : In a nuclear CPU Run in
parallel : In multi-core CPU Run in
Coroutines and threads
- coroutines : User mode lightweight threads ,KB Level
- Threads : Kernel mode , It can run multiple Synergetics ,MB Level
Co process communication
channel( Is it synchronized -> The efficiency of consumption and production varies )
Lock( Concurrent security )
sync Under bag Mutex, Locking ensures concurrency security
WaitGroup
Method :
structure :
test
unit testing
The rules
assert( Example :assert.Equal() Method , Quickly compare and judge the test results )
coverage (
)<===“–cover”
rely on ((mock Mechanism ) idempotent 、 Stable ==》 Pile driving )
idempotent : Every test run should produce the same results as before
Mockey Patch The scope of Runtime, Pass... At run time Go Of unsafe package , Replace the address of the function in memory with the address of the runtime function . Jump the implementation of the function or method to be driven .
The benchmark
Test the performance and CPU Loss of
ps: perform rand It takes a long time , because rand In order to ensure global randomness and concurrency security , Holds a global lock , Therefore, it is recommended to use a high-performance random number method fastrand, At the expense of certain sequence consistency .
Add
The difference between the two forms of login
One 、Cookie and Session
This is generally used for authentication when interacting with the client .
Two 、JWT+Token
No need to rely on some storage , Generally, the backend decrypts directly .
It usually lies in the server 、http If you interact , Use JWT+token
Message queuing application scenario
The main problem to be solved is isolation
Use scenarios : The two methods , If it's a strong dependence , It cannot be achieved in this way
If it is non strong dependency , Method A Is to release a message 、 event , Method B It is to receive and consume this event for asynchronous processing , In this case, use message queuing , Can play a decoupling function
Strong dependence , It cannot be achieved in this way
If it is non strong dependency , Method A Is to release a message 、 event , Method B It is to receive and consume this event for asynchronous processing , In this case, use message queuing , Can play a decoupling function
边栏推荐
- Implementation of AVL tree
- Outlier detection technology of time series data
- Sword finger offer high quality code
- Detailed explanation of transform origin attribute
- Academic report series (VI) - autonomous driving on the journey to full autonomy
- Several important steps to light up the display
- Answer to the second stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition
- 詳解機器翻譯任務中的BLEU
- Lvs+kept (DR mode) learning notes
- Communication between non parent and child components
猜你喜欢
Esxi attaching mobile (Mechanical) hard disk detailed tutorial
Fast quantitative, abbkine protein quantitative kit BCA method is coming!
main函数在import语句中的特殊行为
抽丝剥茧C语言(高阶)指针的进阶
云备份项目
Non empty verification of collection in SQL
MIPS uclibc cross compile ffmpeg, support g711a encoding and decoding
记一个并发规则验证实现
Le Service MySQL manque dans le service informatique
Jesd204b clock network
随机推荐
Fullgc problem analysis and solution summary
Special behavior of main function in import statement
关于二进制无法精确表示小数
Wechat applet full stack development practice Chapter 3 Introduction and use of APIs commonly used in wechat applet development -- 3.10 tabbar component (I) how to open and use the default tabbar comp
FullGC问题分析及解决办法总结
我理想的软件测试人员发展状态
IP address
Sword finger offer high quality code
詳解機器翻譯任務中的BLEU
修改Jupyter Notebook文件路径
1090: integer power (multi instance test)
mips uclibc 交叉编译ffmpeg,支持 G711A 编解码
07_ Handout on the essence and practical skills of text measurement and geometric transformation
js小练习----分时提醒问候、表单密码显示隐藏效果、文本框焦点事件、关闭广告
抽丝剥茧C语言(高阶)数据的储存+练习
Implementing data dictionary with JSP custom tag
父组件传递给子组件:Props
Nesting and splitting of components
AVL树的实现
JS small exercise