LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.
-
Upload
blaze-turner -
Category
Documents
-
view
221 -
download
1
Transcript of LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.
![Page 1: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/1.jpg)
LOGO
Erlang11 ACM 王浩然
![Page 2: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/2.jpg)
Company Logo
concurrency
in real world
in computer
![Page 3: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/3.jpg)
Company Logo
concurrency
Here, we encounter a quz.
![Page 4: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/4.jpg)
Company Logo
concurrency
x = x+n. 1.mov ax,[bp +x] 2.mov bx,n 3.add ax,bx 4.mov[bp+x],ax
multi-process share the registers.
![Page 5: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/5.jpg)
Company Logo
concurrency
If there is a Way or PL supporting this?
Yes! COP, Erlang.
![Page 6: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/6.jpg)
Company Logo
concurrency
Let's change a model.
The relation of the multi-process to a computer
staff to a community
![Page 7: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/7.jpg)
Company Logo
concurrency
Properties:• Independent
• No sharing memory
• Sending message
![Page 8: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/8.jpg)
Company Logo
Concurrency Primitives
Pid = Spawn(fun)
Pid ! Message
receive ... end
![Page 9: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/9.jpg)
Receive Pattern
![Page 10: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/10.jpg)
Company Logo
Concurrency
A simple model
Client & Server
Sending& Receiving
![Page 11: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/11.jpg)
Company Logo
rect
![Page 12: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/12.jpg)
Company Logo
clock
What if never receive a message? waiting forever?
after
![Page 13: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/13.jpg)
![Page 14: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/14.jpg)
![Page 15: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/15.jpg)
![Page 16: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/16.jpg)
Company Logo
Other features
Variable!• no type declaration.
![Page 17: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/17.jpg)
Company Logo
Variable
A strange fact
![Page 18: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/18.jpg)
Company Logo
Variable
What on earth is going on here??
Explain• X not a variable• = is not an assignment operator
Why is this?
![Page 19: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/19.jpg)
Company Logo
Other features
"=", Pattern Matching Operator
can apply on storing compound data
![Page 20: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/20.jpg)
overload the function:
![Page 21: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/21.jpg)
Company Logo
Other features
Functional Programming• function: first class, same as other data types.
![Page 22: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/22.jpg)
![Page 23: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/23.jpg)
Company Logo
Summary
Not totally understanding
Still Missed Many Advantage
![Page 24: LOGO Erlang 11 ACM 王浩然. Company Logo concurrency in real world in computer.](https://reader035.fdocuments.us/reader035/viewer/2022062423/5697c01d1a28abf838cd0b4d/html5/thumbnails/24.jpg)
LOGO