zoukankan      html  css  js  c++  java
  • AKKA初体验

    关于thread和actor下面这段话讲的很好
    Experienced developers have learned to be very careful with unrestricted threads and various blocking mechanisms of a (real-time) operating system, because they often lead to programs that are unsafe and difficult to reason about. Instead, experts apply the following best practices of concurrent programming:1.Keep data isolated and bound to threads. Threads should hide (encapsulate) their private data and other resources, and not share them with the rest of the system.2.Communicate among threads asynchronously via messages (event objects). Using asynchronous events keeps the threads running truly independently, without blocking on each other.3.Threads should spend their lifetime responding to incoming events, so their mainline should consist of an event-loop that handles events one at a time (to completion), thus avoiding any concurrency hazards within a thread itself.While these practices can be applied manually on top of the "free threading" approach, a better way is to use the Active Object (Actor) pattern, which inherently supports and automatically enforces the best practices of concurrent programming.

    这个 是介绍Akka在线程封装 隐藏通信~ 线程低耦合 复用执行上面的优点~

    还是从未来的 分布式 并发编程 门槛降低的视角 再介绍akka~

    Netty的使用!

  • 相关阅读:
    面向对象类成员之静态字段
    面向对象中,用super来联系父类的函数
    登录
    奇数偶数
    vue中播放音乐
    vue中的轮播图
    vue中的bind
    vue中的for
    django rest_framework中的APIView,ModelViewSet,认证,权限,频率,版本
    django rest_framework中的mixins,generics,ModelViewSet中的url简写
  • 原文地址:https://www.cnblogs.com/drawwindows/p/5220331.html
Copyright © 2011-2022 走看看