草稿

并发编程沉思录

https://robey.lag.net/2009/03/02/actors-mina-and-naggati.html

http://tutorials.jenkov.com/java-concurrency/concurrency-models.html

管理

线程、抽象

分解

复用

并发编程实际上是一个运行时复杂系统的管理工具。

任务处理模型:

事件、线程

事件消费模型(线程复用模型)

1、无复用—需要多少创建多少;

2、线程池复用—通过线程状态复用;

3、线程(事件)循环复用;

调度管理:

1、调度到线程上;

2、调度到线程的消费队列;

3、调度到管理队列上,管理队列再进行派发。

依赖管理:

资源依赖管理:锁

状态依赖管理:通信

线程无关抽象;

无锁化处理:

线程的状态:

运行以后再无start;只能通过循环来维持生命。

分层模型

一、基础分层

线程层

控制层

资源层

二、线程池模型分层

应用层

管理层

线程层

控制层

资源层

应用层

表示层

会话层

线程层

控制层

资源层

In computer science, concurrency refers to the ability of different parts or units of a program, algorithm, or problem to be executed out-of-order or in partial order, without affecting the final outcome.

多任务基于共享的资源同时执行,输出一致的结果。

原文地址:https://www.cnblogs.com/feng9exe/p/11869157.html