当前位置:网站首页>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();
}}
}
边栏推荐
- How to migrate or replicate VMware virtual machine systems
- PHP install the spool extension
- Simple understanding of bubble sorting
- 机器学习 | 简单但是能提升模型效果的特征标准化方法(RobustScaler、MinMaxScaler、StandardScaler 比较和解析)
- 深度学习参数初始化(一)Xavier初始化 含代码
- IC_EDA_ALL虚拟机(丰富版):questasim、vivado、vcs、verdi、dc、pt、spyglass、icc2、synplify、INCISIVE、IC617、MMSIM、工艺库
- The essence of interview
- Error c2017: illegal escape sequence
- 卡特兰数(Catalan)的应用场景
- dataworks自定義函數開發環境搭建
猜你喜欢

2022 East China Normal University postgraduate entrance examination machine test questions - detailed solution

2022-06-23 VGMP-OSPF-域間安全策略-NAT策略(更新中)

Inno Setup 制作安装包

Reading notes of "learn to ask questions"

golang操作redis:写入、读取kv数据

Summary of remote connection of MySQL

Sorting out the core ideas of the pyramid principle

Software testing learning - day 3

Practice of enterprise ab/testing platform

卡特兰数(Catalan)的应用场景
随机推荐
Inno Setup 制作安装包
Winter vacation work of software engineering practice
Split small interface
Summary of remote connection of MySQL
Use the jvisualvm tool ----- tocmat to start JMX monitoring
[vscode - vehicle plug-in reports an error] cannot find module 'xxx' or its corresponding type declarations Vetur(2307)
Distributed lock
What are the characteristics and functions of the scientific thinking mode of mechanical view and system view
Practice of enterprise ab/testing platform
Strategy mode
每日刷题记录 (十一)
Daily question brushing record (11)
(翻译)异步编程:Async/Await在ASP.NET中的介绍
Software testing learning - day one
多个全局异常处理类,怎么规定执行顺序
Know flex box
New knowledge! The virtual machine network card causes your DNS resolution to slow down
Simple understanding of bubble sorting
php artisan
Laravel frame step pit (I)