[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
<>线程调度方式
线程调度是指系统为线程分配CPU使用权的过程,有两种方式,java为抢占式线程调度
抢占式线程调度
协同式线程调度
<>线程创建方式
官方说有两种:一种是派生Thread,一种实现Runnable 方式;但本质就是一种new Thread();方式
也有说:继承Thread,实现Runnable ,实现Callable,以及线程池方式,总共四种
其中callable本质是转换Runnable 的方式,线程池方式说到底不是创建,而是池化技术,避免反复创建
所以,以官方说法为主:两种创建线程的方式
线程中断:interrupt()
syart()方法被调用两次会抛出异常
<>线程的生命周期
初始
运行
阻塞
等待
超时等待
终止
<>进程之间的通讯机制
管道
信号
消息队列
共享内存
信号量
套字接
<>管道
<>T1,T2,T3三个线程依次执行方案
join()。T3想要T2执行完再执行,需要T3线程调用T2的jion()方法【join的含义就是把T1线程加到T2线程执行的代码中去,把T1的代码执行完,T2剩下的代码才能执行】
<>synchorized内置锁
<>Volatile
<>方法和锁