当前位置:网站首页>Advanced APL (realize group chat room)
Advanced APL (realize group chat room)
2022-07-03 07:01:00 【Bugxiu_ fu】
Producer thread ( One or more ) Make bread and put it in the basket ( Set or array ), meanwhile , Consumer thread ( One or more ) From the basket ( Set or array ) Take out the bread and consume . Although their tasks are different , But the processing resources are the same , This reflects a way of communication between threads .
Factory f=null;
public Producter(Factory f) {
this.f=f;
}
private int count=1;
@Override
public synchronized void run() {
while (true) {
f.addPro(new Product(count, " A chicken leg "+count+" Number "));
count++;
try {
Thread.sleep(50);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}}
}
边栏推荐
- 2022-06-23 VGMP-OSPF-域間安全策略-NAT策略(更新中)
- Strategy mode
- Setting up the development environment of dataworks custom function
- Ruoyi interface permission verification
- Abstract learning
- Tool class static method calls @autowired injected service
- JMeter JSON extractor extracts two parameters at the same time
- Crontab scheduled task
- Troubleshooting of high CPU load but low CPU usage
- Journal quotidien des questions (11)
猜你喜欢
Use the jvisualvm tool ----- tocmat to start JMX monitoring
Summary of the design and implementation of the weapon system similar to the paladin of vitality
【类和对象】深入浅出类和对象
机器学习 | 简单但是能提升模型效果的特征标准化方法(RobustScaler、MinMaxScaler、StandardScaler 比较和解析)
10000小時定律不會讓你成為編程大師,但至少是個好的起點
dataworks自定义函数开发环境搭建
[Fiddler actual operation] how to use Fiddler to capture packets on Apple Mobile Phones
10000小时定律不会让你成为编程大师,但至少是个好的起点
La loi des 10 000 heures ne fait pas de vous un maître de programmation, mais au moins un bon point de départ
Daily question brushing record (11)
随机推荐
Laravel Web Framework
Journal quotidien des questions (11)
Mise en place d'un environnement de développement de fonctions personnalisées
Split small interface
Inno Setup 制作安装包
2022-06-23 VGMP-OSPF-域間安全策略-NAT策略(更新中)
2022 - 06 - 23 vgmp - OSPF - Inter - Domain Security Policy - nat Policy (Update)
Practice of enterprise ab/testing platform
Sorting out the core ideas of the pyramid principle
Golang operation redis: write and read hash type data
每日刷題記錄 (十一)
Flask Foundation
2022-06-23 vgmp OSPF inter domain security policy NAT policy (under update)
如何迁移或复制VMware虚拟机系统
Selenium key knowledge explanation
利用C#实现Pdf转图片
【类和对象】深入浅出类和对象
Personally design a highly concurrent seckill system
Resttemplate configuration use
MySQL syntax (basic)