当前位置:网站首页>Detailed introduction of distributed pressure measurement system VIII: basic introduction of akka actor model
Detailed introduction of distributed pressure measurement system VIII: basic introduction of akka actor model
2022-07-06 20:17:00 【Wang Wei, Wang Pangpang】
The distributed pressure measurement system is introduced in detail :akka actor Basic introduction of the model
actor Model
Previous picture , I got it online :
It looks like sending email , Think of this model as sending email , And there's a mailbox , It seems to be multi person communication , One actor It's just one person ,actor Communicate with each other , Using email . I have used email at ordinary times , What are the characteristics of email , Is the advantage of asynchronous non blocking , The sender may not care when the receiver receives , Whether it has been handled , He just sends it to his mailbox , Of course, the recipient is also , He doesn't care who sent it to him , If he wants to deal with the mail, he takes it out of the mailbox , Process according to the specific email content .
characteristic
- Asynchronous non-blocking , Those who write letters belong to those who write letters , Write it and put it in the mailbox , The receiver belongs to the receiver , Deal with it whenever you want , In fact, it is similar to message queue , Send a message to the queue and it's done , Go on with the rest , That is, the thread can not wait .
- Data is isolated from each other , Event driven , Those who write letters cannot control the receipt , What the recipient wants to do is up to him , His own data can only be modified by himself , Relative to others is isolation , That is, there is no need to share data , Maintain their own data , Only modify the data according to the incoming letter , And the letters are orderly in the queue , The time to deal with it is 1 Sealed , Therefore, there is no concurrent data sharing problem
- No need for synchronous lock , There is no shared data , There is no need for synchronous lock
- Good concurrency , There is no need for threads to synchronize in order to share resources , Greatly improve the utilization of threads
akka System structure
Whole actor In fact, it is an attribute structure , It should be convenient for unified management, scheduling and query :
akka Core elements

akka Dependencies between core elements
You can see ,actorCell You can visit Actor, however actorCell It's internal ,Actor No direct access , therefore ,Actor You can't directly modify another Actor The state of , Thread safety can be achieved 
akka actor System initialization process

akka actor The system creates a node process

akka actor Send and process messages

The above are sorted out from the source code , There may be something wrong , Some specific details should be read by yourself .
Okay , That's it today , I hope it is helpful for learning and understanding , Don't spray when the great God sees , Only for their own learning and understanding , Limited ability , Please forgive me .
边栏推荐
- 枚举根据参数获取值
- JS get browser system language
- JS implementation force deduction 71 question simplified path
- 某东短信登录复活 安装部署教程
- 腾讯T3大牛手把手教你,大厂内部资料
- js实现力扣71题简化路径
- POJ1149 PIGS 【最大流量】
- (3) Web security | penetration testing | basic knowledge of network security construction, IIS website construction, EXE backdoor generation tool quasar, basic use of
- Crawler (14) - scrape redis distributed crawler (1) | detailed explanation
- rt-thread i2c 使用教程
猜你喜欢

Tencent T3 teaches you hand in hand. It's really delicious

系统与应用监控的思路和方法
Tencent architects first, 2022 Android interview written examination summary

Tencent Android interview must ask, 10 years of Android development experience

Speech recognition (ASR) paper selection: talcs: an open source Mandarin English code switching corps and a speech

Enumeration gets values based on parameters

数字三角形模型 AcWing 1018. 最低通行费
Tencent T4 architect, Android interview Foundation

【Yann LeCun点赞B站UP主使用Minecraft制作的红石神经网络】

A5000 vGPU显示模式切换
随机推荐
New generation garbage collector ZGC
JS get browser system language
深度学习分类网络 -- ZFNet
Tencent architects first, 2022 Android interview written examination summary
Crawler (14) - scrape redis distributed crawler (1) | detailed explanation
(3) Web security | penetration testing | basic knowledge of network security construction, IIS website construction, EXE backdoor generation tool quasar, basic use of
JS implementation force deduction 71 question simplified path
Ideas and methods of system and application monitoring
新一代垃圾回收器—ZGC
mod_ WSGI + pymssql path SQL server seat
[cloud native and 5g] micro services support 5g core network
颜色(color)转换为三刺激值(r/g/b)(干股)
JVM_常见【面试题】
POJ1149 PIGS 【最大流量】
Is it difficult for small and micro enterprises to make accounts? Smart accounting gadget quick to use
Web开发小妙招:巧用ThreadLocal规避层层传值
2022年6月语音合成(TTS)和语音识别(ASR)论文月报
腾讯字节等大厂面试真题汇总,网易架构师深入讲解Android开发
Poj3617 best cow line
An East SMS login resurrection installation and deployment tutorial