当前位置:网站首页>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 .
边栏推荐
猜你喜欢

Continuous test (CT) practical experience sharing

22-07-05 upload of qiniu cloud storage pictures and user avatars
Tencent T4 architect, Android interview Foundation

HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother

Configuration and simple usage of the EXE backdoor generation tool quasar
腾讯架构师首发,2022Android面试笔试总结

(3) Web security | penetration testing | basic knowledge of network security construction, IIS website construction, EXE backdoor generation tool quasar, basic use of

系统与应用监控的思路和方法

An East SMS login resurrection installation and deployment tutorial

Vscode debug run fluent message: there is no extension for debugging yaml. Should we find yaml extensions in the market?
随机推荐
[Yann Lecun likes the red stone neural network made by minecraft]
8086 instruction code summary (table)
【云原生与5G】微服务加持5G核心网
BUUCTF---Reverse---easyre
永磁同步电机转子位置估算专题 —— 基波模型与转子位置角
POJ1149 PIGS 【最大流量】
句号压缩过滤器
Wechat applet common collection
Appx代码签名指南
String length limit?
PowerPivot——DAX(初识)
Notes on beagleboneblack
New generation garbage collector ZGC
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
颜色(color)转换为三刺激值(r/g/b)(干股)
Unity writes a timer tool to start timing from the whole point. The format is: 00:00:00
Method keywords deprecated, externalprocname, final, forcegenerate
Unity making plug-ins
Crawler (14) - scrape redis distributed crawler (1) | detailed explanation
How to select several hard coded SQL rows- How to select several hardcoded SQL rows?