当前位置:网站首页>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 .
边栏推荐
- Special topic of rotor position estimation of permanent magnet synchronous motor -- fundamental wave model and rotor position angle
- Cesium Click to draw a circle (dynamically draw a circle)
- BeagleBoneBlack 上手记
- [network planning] Chapter 3 data link layer (3) channel division medium access control
- Node. Js: express + MySQL realizes registration, login and identity authentication
- 5. 无线体内纳米网:十大“可行吗?”问题
- Ideas and methods of system and application monitoring
- String长度限制?
- What happened to the kernel after malloc() was transferred? Attached malloc () and free () implementation source
- Oceanbase Community Edition OBD mode deployment mode stand-alone installation
猜你喜欢
Anaconda安装后Jupyter launch 没反应&网页打开运行没执行
Tencent T4 architect, Android interview Foundation
Tencent T2 Daniel explained in person and doubled his job hopping salary
腾讯字节阿里小米京东大厂Offer拿到手软,老师讲的真棒
B-杰哥的树(状压树形dp)
腾讯T3手把手教你,真的太香了
腾讯T4架构师,android面试基础
Tencent Android interview must ask, 10 years of Android development experience
Standardized QCI characteristics
Tencent architects first, 2022 Android interview written examination summary
随机推荐
Period compression filter
Notes on beagleboneblack
技术分享 | 抓包分析 TCP 协议
SSH connection denied
Tencent T2 Daniel explained in person and doubled his job hopping salary
转让malloc()该功能后,发生了什么事内核?附malloc()和free()实现源
A5000 vgpu display mode switching
某东短信登录复活 安装部署教程
Method keywords deprecated, externalprocname, final, forcegenerate
PHP and excel phpexcel
Initial experience of addresssanitizer Technology
leetcode先刷_Maximum Subarray
系统与应用监控的思路和方法
How to select several hard coded SQL rows- How to select several hardcoded SQL rows?
mod_wsgi + pymssql通路SQL Server座
【GET-4】
案例 ①|主机安全建设:3个层级,11大能力的最佳实践
Unity writes a timer tool to start timing from the whole point. The format is: 00:00:00
Problems encountered in using RT thread component fish
js获取浏览器系统语言