当前位置:网站首页>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();
}}
}
边栏推荐
- 深度学习参数初始化(一)Xavier初始化 含代码
- Sorting out the core ideas of the pyramid principle
- Laravel框架 踩坑(一)
- Distributed lock
- CentOS switches and installs mysql5.7 and mysql8.0
- 如何迁移或复制VMware虚拟机系统
- File links cannot be opened or downloaded in Google browser
- Abstract learning
- 【code】if (list != null && list.size() > 0)优化,集合判空实现方式
- Book recommendation~
猜你喜欢

Software testing learning - day 3

(翻译)异步编程:Async/Await在ASP.NET中的介绍

Practical plug-ins in idea

Pytest -- write and manage test cases

Interfaces and related concepts

Software testing learning - day one
![Gridome + strapi + vercel + PM2 deployment case of [static site (3)]](/img/65/8d79998e96a2c74ba6e237bee652c6.jpg)
Gridome + strapi + vercel + PM2 deployment case of [static site (3)]

Sorting out the core ideas of the pyramid principle

利用C#实现Pdf转图片

golang操作redis:写入、读取kv数据
随机推荐
这两种驱蚊成份对宝宝有害,有宝宝的家庭,选购驱蚊产品要注意
Hands on redis master-slave replication, sentinel master-slave switching, cluster sharding
Ruoyi interface permission verification
POI excel percentage
PHP install the spool extension
How does the insurance company check hypertension?
Summary of remote connection of MySQL
Interfaces and related concepts
JMeter JSON extractor extracts two parameters at the same time
How can the server set up multiple interfaces and install IIS? Tiantian gives you the answer!
[LeetCode]404. Sum of left leaves
机器学习 | 简单但是能提升模型效果的特征标准化方法(RobustScaler、MinMaxScaler、StandardScaler 比较和解析)
10 000 volumes - Guide de l'investisseur en valeur [l'éducation d'un investisseur en valeur]
[classes and objects] explain classes and objects in simple terms
Inno setup production and installation package
MySQL transaction rollback, error points record
DNS forward query:
Software testing learning - day 3
Architecture notes
【类和对象】深入浅出类和对象