当前位置:网站首页>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();
}}
}
边栏推荐
- File links cannot be opened or downloaded in Google browser
- 10000小时定律不会让你成为编程大师,但至少是个好的起点
- mysql误删root账户导致无法登录
- On the practice of performance optimization and stability guarantee
- Inno setup production and installation package
- Summary of the design and implementation of the weapon system similar to the paladin of vitality
- Thoughts in Starbucks
- Centos切换安装mysql5.7和mysql8.0
- Split small interface
- Golang operation redis: write and read kV data
猜你喜欢

Winter vacation work of software engineering practice

【类和对象】深入浅出类和对象

The 10000 hour rule won't make you a master programmer, but at least it's a good starting point

New knowledge! The virtual machine network card causes your DNS resolution to slow down

On the practice of performance optimization and stability guarantee

多个全局异常处理类,怎么规定执行顺序

Practice of enterprise ab/testing platform

Win 10 find the port and close the port

golang操作redis:写入、读取hash类型数据

Inno setup production and installation package
随机推荐
JMeter JSON extractor extracts two parameters at the same time
Basic components and intermediate components
Laravel Web框架
Software testing assignment - day 1
Advanced API (byte stream & buffer stream)
[LeetCode]404. Sum of left leaves
2022-06-23 vgmp OSPF inter domain security policy NAT policy (under update)
Pytest attempts to execute the test case without skipping, but the case shows that it is all skipped
Pytest -- write and manage test cases
Error c2017: illegal escape sequence
How can I split a string at the first occurrence of “-” (minus sign) into two $vars with PHP?
Simple understanding of bubble sorting
Reading notes of "learn to ask questions"
熊市里的大机构压力倍增,灰度、Tether、微策略等巨鲸会不会成为'巨雷'?
Climb movie paradise 2021 hot
The essence of interview
Upgrade CentOS php7.2.24 to php7.3
golang操作redis:写入、读取hash类型数据
dataworks自定义函数开发环境搭建
Class and object summary