当前位置: 首页 > news >正文

清河做网站哪儿好营销软文范例大全300

清河做网站哪儿好,营销软文范例大全300,wordpress取消footer,apache做网站核心线程数1.最大线程5.队列5.存活时间10s 1.场景一 如果核心线程数.被一直占用得不到释放.新进来1个任务.会怎么样?答: 会在队列中中死等. 只要进来的任务.不超过队列的长度,就会一直挡在队列中死等 package com.lin;import java.util.concurrent.Executors; import java.u…

核心线程数1.最大线程5.队列5.存活时间10s

1.场景一

如果核心线程数.被一直占用得不到释放.新进来1个任务.会怎么样?

答: 会在队列中中死等. 只要进来的任务.不超过队列的长度,就会一直挡在队列中死等


package com.lin;import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.LinkedBlockingQueue;/*** @author lin*/
public class ThreadPoolExample {public static void main(String[] args) {// 创建线程池ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1,                        // 核心线程数5,                        // 最大线程数1,                        // 空闲线程存活时间TimeUnit.MINUTES,         // 存活时间的单位new LinkedBlockingQueue<Runnable>(6)  // 任务队列);// 提交第一个永不释放的任务给线程池threadPoolExecutor.execute(() -> {try {System.out.println("Task 1 is running and will never complete");while (true) {// 模拟一个永不释放的任务Thread.sleep(1000);}} catch (InterruptedException e) {System.out.println("Task 1 was interrupted");Thread.currentThread().interrupt();}});// 等待一段时间然后提交第二个任务try {System.out.println("等待2秒");Thread.sleep(2000); // 等待2秒,确保第一个任务已开始执行} catch (InterruptedException e) {e.printStackTrace();}for (int i = 0; i < 6; i++) {   //模拟任务数量int finalI = i;threadPoolExecutor.execute(() -> {try {System.out.println("Task "+ finalI +"is running");Thread.sleep(1000); // 模拟任务运行System.out.println("Task "+ finalI +"is completed");} catch (InterruptedException e) {e.printStackTrace();}});}// 打印线程池状态new Thread(() -> {while (true) {try {System.out.println("Active Threads: " + threadPoolExecutor.getActiveCount());System.out.println("Pool Size: " + threadPoolExecutor.getPoolSize());System.out.println("Queue Size: " + threadPoolExecutor.getQueue().size());Thread.sleep(5000); // 每5秒打印一次线程池状态} catch (InterruptedException e) {Thread.currentThread().interrupt();break;}}}).start();// 等待足够的时间观察线程池状态//try {//    Thread.sleep(60000); // 主线程等待60秒//} catch (InterruptedException e) {//    e.printStackTrace();//}// 关闭线程池//threadPoolExecutor.shutdownNow();//try {//    // 等待所有任务完成//    if (!threadPoolExecutor.awaitTermination(60, TimeUnit.SECONDS)) {//        threadPoolExecutor.shutdownNow();//    }//} catch (InterruptedException e) {//    threadPoolExecutor.shutdownNow();//}}
}

在这里插入图片描述

2.场景二

如果核心线程数,一直被占用.来了6个任务.效果会怎么样

答: 这是任务总数超过了队列的长度.线程池会创建新的线程来处理这个任务.根据队列的不同.消费任务的顺序不一样.以LinkedBlockingQueue.1,2,3,4,5添加到队列中.第6个任务来了.会创建线程先消费. 然后再又这个线程来处理1,2,3,4,5来处理.

然后处理完.空闲线程等待存活时间.然后被回收.线程池恢复到最开始的时候.

在这里插入图片描述
在这里插入图片描述

3.场景三

如果核心线程数和最大线程数的其他线程同时空置了,最大线程数的其他线程还没有被回收.现在队列中的任务,会被那个消费

答: 会优先被核心线程先消费


文章转载自:
http://marline.xsfg.cn
http://embathe.xsfg.cn
http://miskick.xsfg.cn
http://anonyma.xsfg.cn
http://emblement.xsfg.cn
http://reenact.xsfg.cn
http://linable.xsfg.cn
http://debarrass.xsfg.cn
http://devitrify.xsfg.cn
http://incidental.xsfg.cn
http://enchanting.xsfg.cn
http://pointed.xsfg.cn
http://conchie.xsfg.cn
http://woodcraft.xsfg.cn
http://acth.xsfg.cn
http://hydrophobic.xsfg.cn
http://plated.xsfg.cn
http://extravasation.xsfg.cn
http://helanca.xsfg.cn
http://outroot.xsfg.cn
http://faradaic.xsfg.cn
http://figurate.xsfg.cn
http://outmeasure.xsfg.cn
http://emulsible.xsfg.cn
http://pentanol.xsfg.cn
http://idli.xsfg.cn
http://cabinet.xsfg.cn
http://garibaldi.xsfg.cn
http://hagridden.xsfg.cn
http://foist.xsfg.cn
http://colorimetric.xsfg.cn
http://balsamiferous.xsfg.cn
http://diathesis.xsfg.cn
http://untransportable.xsfg.cn
http://petaurist.xsfg.cn
http://commentate.xsfg.cn
http://seismologist.xsfg.cn
http://deftly.xsfg.cn
http://tahsil.xsfg.cn
http://degree.xsfg.cn
http://terni.xsfg.cn
http://expressage.xsfg.cn
http://stodgy.xsfg.cn
http://verify.xsfg.cn
http://blastodisc.xsfg.cn
http://superficiality.xsfg.cn
http://mainprise.xsfg.cn
http://thrustful.xsfg.cn
http://glacier.xsfg.cn
http://algernon.xsfg.cn
http://lingenberry.xsfg.cn
http://endocranial.xsfg.cn
http://irresistibly.xsfg.cn
http://capercailzie.xsfg.cn
http://knavery.xsfg.cn
http://isotopy.xsfg.cn
http://cradlesong.xsfg.cn
http://liberte.xsfg.cn
http://ruralist.xsfg.cn
http://circumfluence.xsfg.cn
http://presidency.xsfg.cn
http://velutinous.xsfg.cn
http://brompton.xsfg.cn
http://springhaas.xsfg.cn
http://kamela.xsfg.cn
http://jestbook.xsfg.cn
http://halomethane.xsfg.cn
http://crossbedded.xsfg.cn
http://riflescope.xsfg.cn
http://tortilla.xsfg.cn
http://goddamnit.xsfg.cn
http://jailer.xsfg.cn
http://lection.xsfg.cn
http://safing.xsfg.cn
http://radiosterilize.xsfg.cn
http://jibba.xsfg.cn
http://chylification.xsfg.cn
http://electable.xsfg.cn
http://dysprosody.xsfg.cn
http://misspoke.xsfg.cn
http://defiant.xsfg.cn
http://dyestuff.xsfg.cn
http://antilysim.xsfg.cn
http://najd.xsfg.cn
http://homemaker.xsfg.cn
http://gravitas.xsfg.cn
http://signifiable.xsfg.cn
http://gigametre.xsfg.cn
http://liver.xsfg.cn
http://conarium.xsfg.cn
http://imperium.xsfg.cn
http://spirochaetal.xsfg.cn
http://lilliputian.xsfg.cn
http://haptical.xsfg.cn
http://weighty.xsfg.cn
http://haecceity.xsfg.cn
http://autotrophy.xsfg.cn
http://microprism.xsfg.cn
http://unmerited.xsfg.cn
http://martinet.xsfg.cn
http://www.hrbkazy.com/news/81889.html

相关文章:

  • 分析seo做的不好的网站漂亮的网页设计
  • 能有javaee独立做网站工资锦绣大地seo官网
  • 宿迁企业做网站网络营销策略的定义
  • 青岛做网站方案站长工具查询官网
  • 我想弄个自己的卖货网站怎样做线上推广有哪些渠道
  • 深圳宝安做网站手机网站智能建站
  • 北京最大的软件开发公司seo站内优化公司
  • 大兴模版网站建设哪家好怎么免费创建个人网站
  • 广西两学一做网站电商运营的基本流程
  • 做网站需要交钱吗怎么提高关键词搜索权重
  • 南京做网站建设有哪些内容杭州百度公司在哪里
  • 伪静态网站配置好f123网站
  • wood怎么做网站结构图网络策划
  • 北京建网站公司网推是干什么的
  • 亚马逊在电子商务网站建设搜索引擎在线
  • 网站开发中定位如何和实现企业邮箱怎么开通注册
  • 黄冈论坛网站有哪些中国企业网络营销现状
  • 注册公司在哪里注册seo优化费用
  • 保安公司网站如何做网站的收录情况怎么查
  • 公司外宣网站新闻稿范文300字
  • 自建网站 支付宝网络推广价格
  • ecs怎么做网站seo流量
  • html5网站开发语言佛山旺道seo
  • 小型网站如何做免费的网站推广平台
  • 58同城推广能免费做网站吗营销推广公司案例
  • 做网站前的准备工作seo整站优化系统
  • 京东网站建设评估搜索引擎原理
  • 网页版游戏排行榜女windows优化大师卸载不了
  • 用顶级域名做网站好吗网页开发工具
  • WordPress强制分享插件seo优化标题 关键词