Giter Site home page Giter Site logo

java-concurrency's Introduction

Java并发编程

Java 1.4 时代

  • 并发实现
    • Java Green Thread 绿色线程
    • Java Native Thread
  • 编程模型
    • Thread
    • Runnable
  • 实现局限性
    • 缺少线程管理的原声支持(没有线程池)
    • 缺少执行完成的原声支持
    • 执行结果获取困难
    • Double Check Locking 不确定性(双检查锁,单例模式,线程安全)
    • 缺少”锁“API(线程安全)

Java 5 时代

  • 并发框架
    • J.U.C = java.util.concurrent
  • 编程模型
    • Executor
    • Runnable、Callable
    • Future

Java 7 时代

  • 并行框架
    • Fork/Join(参与、完成,递归的二分法)
  • 编程模型
    • ForkJoinPool
    • ForkJoinTask
    • RecursiveAction(递归)
  • Future的限制
    • 无法手动完成
    • 阻塞式结果返回
    • 无法链式多个Future
    • 无法合并多个Future结果
    • 缺少异常处理

Java 8 时代

  • 异步并行框架
    • Fork/Join
  • 编程模型
    • CompletionStage
    • CompletableFuture(异步结果处理、链式处理、合并结果、异常处理)

Reactive Streams

  • 核心
    • Publisher 发布者
    • Subscriber 订阅者
    • Subcription 订阅内容
    • Processor = Publisher + Subscriber
  • ReactiveStreams
  • ReactiveX: 异步(asynchronous )、基于事件(event-based)、观察者(observable )

Java 9 前时代

  • 观察者模式:Java支持
  • 事件监听模式:Java Beans = POJO
  • Reactor(反应)模式,NIO

Java 9 时代

  • Flow Api
    • SubmissionPublisher

java-concurrency's People

Contributors

xuda27 avatar

Stargazers

lzyer avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.