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

新乡网站建设官网网站图片少影响seo吗

新乡网站建设官网,网站图片少影响seo吗,网页小游戏网址,单机网页小游戏本文介绍两种主线程等待子线程的实现方式#xff0c;以5个子线程来说明#xff1a;1、使用Thread的join()方法#xff0c;join()方法会阻塞主线程继续向下执行。2、使用Java.util.concurrent中的CountDownLatch#xff0c;是一个倒数计数器。初始化时先设置一个倒数计数初始…本文介绍两种主线程等待子线程的实现方式以5个子线程来说明1、使用Thread的join()方法join()方法会阻塞主线程继续向下执行。2、使用Java.util.concurrent中的CountDownLatch是一个倒数计数器。初始化时先设置一个倒数计数初始值每调用一次countDown()方法倒数值减一他的await()方法会阻塞当前进程直到倒数至0。join方式代码如下package com.test.thread;import java.util.ArrayList;import java.util.List;public class MyThread extends Thread{public MyThread(String name){this.setName(name);}Overridepublic void run(){System.out.println(this.getName() staring...);System.out.println(this.getName() end...);}/*** param args*/public static void main(String[] args){System.out.println(main thread starting...);List list new ArrayList();for (int i 1; i 5; i){MyThread my new MyThread(Thrad i);my.start();list.add(my);}try{for (MyThread my : list){my.join();}}catch (InterruptedException e){e.printStackTrace();}System.out.println(main thread end...);}}运行结果如下main thread starting...Thrad 2 staring...Thrad 2 end...Thrad 4 staring...Thrad 4 end...Thrad 1 staring...Thrad 1 end...Thrad 3 staring...Thrad 3 end...Thrad 5 staring...Thrad 5 end...main thread end...CountDownLatch方式代码如下package com.test.thread;import java.util.concurrent.CountDownLatch;public class MyThread2 extends Thread{private CountDownLatch count;public MyThread2(CountDownLatch count, String name){this.count count;this.setName(name);}Overridepublic void run(){System.out.println(this.getName() staring...);System.out.println(this.getName() end...);this.count.countDown();}/*** param args*/public static void main(String[] args){System.out.println(main thread starting...);CountDownLatch count new CountDownLatch(5);for (int i 1; i 5; i){MyThread2 my new MyThread2(count, Thread i);my.start();}try{count.await();}catch (InterruptedException e){e.printStackTrace();}System.out.println(main thread end...);}}运行结果如下main thread starting...Thread 2 staring...Thread 2 end...Thread 4 staring...Thread 4 end...Thread 1 staring...Thread 1 end...Thread 3 staring...Thread 3 end...Thread 5 staring...Thread 5 end...main thread end..转自http://blog.csdn.net/nms312/article/details/30115055
http://www.zqtcl.cn/news/590236/

相关文章:

  • 家纺网站模板wordpress折叠菜单
  • 建设信用中国网站站群系统破解版
  • 百度怎么投放广告凡科网站可以做seo优化
  • 医院网站建设 不足好的手机网站建设公司
  • 简历上作品展示网站链接怎么做wordpress的登陆地址修改密码
  • 深圳做响应式网站公司公司网站开发费用放在什么科目
  • 网站页面上的悬浮窗怎么做简单好看的版面设计图
  • 我要在58上面做网站硬件开发和嵌入式的区别
  • 西安网站推广慧创新手怎么开网店
  • 做羞羞事视频网站网站策划书基本项目
  • 对网站建设的维护优秀设计网站推荐
  • 口红机网站怎么做wordpress 搭建个人网站
  • 黄金网站房地产网站建设意义
  • 百度网站联盟公司做网站计入那个科目
  • 越秀电子商务网站建设国外的ui设计思想网站
  • 网站关键词优化公司网站建设完成确认书
  • 企业微信网站怎么建设山东有哪些网络公司
  • 做任务领佣金的网站源码页面设计参评
  • 淘宝联盟个人网站怎么做企业年度报告公示系统
  • 长沙企业网页设计哪家专业网站优化seo
  • 网站设计 西安漂亮企业网站源码
  • 云南省科技网站网页设计师有前途吗
  • 漳州网站开发找出博大科技慈溪市建设局网站表格下载
  • 网站到期怎么续费公司网站asp源码
  • 多个域名 一个网站域名解析官网
  • 中国建设银行企业网站旅游网页代码模板
  • 湛江免费企业建站wordpress archives
  • 建个企业网站多少钱图书管理系统网站开发教程
  • 淘宝客网站建设详细教程wordpress转dz
  • 银川网站推广i深建官方网站