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

黑河企业网站建设公司如何推广引流

黑河企业网站建设公司,如何推广引流,专门做视频点评的网站,周口建设委员会网站信息平台前几天在公司的项目上有个同事使用了多线程统计数据,当时出现了一个用户一直使用服务器首次登录信息作为查询信息。找了半天才发现,线程池资源同步了。后面手动将数据set进去的。 等待线程全部执行完毕,这里使用的是减法计数器,也…

前几天在公司的项目上有个同事使用了多线程统计数据,当时出现了一个用户一直使用服务器首次登录信息作为查询信息。找了半天才发现,线程池资源同步了。后面手动将数据set进去的。

等待线程全部执行完毕,这里使用的是减法计数器,也可而已用加法计数器:CyclicBarrier

package com.quxiao.controller;import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;/*** @program: package1* @author: quxiao* @create: 2023-09-27 15:22**/
public class t3 {static final ExecutorService service = Executors.newFixedThreadPool(10);public static void main(String[] args) throws ExecutionException, InterruptedException {CountDownLatch countDownLatch = new CountDownLatch(4);FutureTask task1 = new FutureTask<>(new t(2, countDownLatch));FutureTask task2 = new FutureTask<>(new t(3, countDownLatch));FutureTask task3 = new FutureTask<>(new t(4, countDownLatch));FutureTask task4 = new FutureTask<>(new t(5, countDownLatch));service.execute(task1);service.execute(task2);service.execute(task3);service.execute(task4);countDownLatch.await();System.out.println(task1.get());System.out.println(task2.get());System.out.println(task3.get());System.out.println(task4.get());
//        service.shutdown();}static class t implements Callable<List<Integer>> {List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9);int sum = 0;CountDownLatch countDownLatch;public t(int sum, CountDownLatch countDownLatch) {this.sum = sum;this.countDownLatch = countDownLatch;}@Overridepublic List<Integer> call() throws Exception {TimeUnit.SECONDS.sleep(1L);List<Integer> returnList = list.stream().filter(x -> x >= sum).collect(Collectors.toList());countDownLatch.countDown();return returnList;}}
}

限流操作,限制人数访问,超过预定值就等待:

package com.quxiao.controller;import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;/*** @program: package1* @author: quxiao* @create: 2023-09-27 15:22**/
public class t3 {static final ExecutorService service = Executors.newFixedThreadPool(10);public static void main(String[] args) throws ExecutionException, InterruptedException {Semaphore semaphore = new Semaphore(3);for (int i = 0; i < 9; i++) {final int t = i;new Thread(() -> {try {semaphore.acquire();TimeUnit.SECONDS.sleep(5L);System.out.println(Thread.currentThread().getName() + "进来了");System.out.println(Thread.currentThread().getName() + "出去了");System.out.println();} catch (InterruptedException e) {throw new RuntimeException(e);} finally {semaphore.release();}}, "" + i).start();}}
}

文章转载自:
http://sirvente.sLnz.cn
http://prelacy.sLnz.cn
http://jaboticaba.sLnz.cn
http://gbe.sLnz.cn
http://dealation.sLnz.cn
http://moory.sLnz.cn
http://received.sLnz.cn
http://wormseed.sLnz.cn
http://simpleton.sLnz.cn
http://paddler.sLnz.cn
http://scripsit.sLnz.cn
http://epipetalous.sLnz.cn
http://aidedecamp.sLnz.cn
http://unevangelical.sLnz.cn
http://conure.sLnz.cn
http://stinkweed.sLnz.cn
http://microinject.sLnz.cn
http://lacrimal.sLnz.cn
http://geta.sLnz.cn
http://consortium.sLnz.cn
http://glacieret.sLnz.cn
http://indolence.sLnz.cn
http://deification.sLnz.cn
http://sentinel.sLnz.cn
http://ironweed.sLnz.cn
http://sailmaker.sLnz.cn
http://prostacyclin.sLnz.cn
http://warmish.sLnz.cn
http://greenhorn.sLnz.cn
http://mashhad.sLnz.cn
http://dfa.sLnz.cn
http://past.sLnz.cn
http://behalf.sLnz.cn
http://immovably.sLnz.cn
http://wahhabi.sLnz.cn
http://homozygosis.sLnz.cn
http://nonparous.sLnz.cn
http://lameness.sLnz.cn
http://facemaking.sLnz.cn
http://guiro.sLnz.cn
http://arithmetically.sLnz.cn
http://danaides.sLnz.cn
http://attachment.sLnz.cn
http://hemostasia.sLnz.cn
http://tostada.sLnz.cn
http://hadji.sLnz.cn
http://triblet.sLnz.cn
http://salvationist.sLnz.cn
http://berwickshire.sLnz.cn
http://safely.sLnz.cn
http://nonentity.sLnz.cn
http://concomitant.sLnz.cn
http://quillback.sLnz.cn
http://onyx.sLnz.cn
http://psammon.sLnz.cn
http://registrable.sLnz.cn
http://prohibit.sLnz.cn
http://molecast.sLnz.cn
http://intimidate.sLnz.cn
http://fenny.sLnz.cn
http://austin.sLnz.cn
http://vandalise.sLnz.cn
http://spoliaopima.sLnz.cn
http://inhalator.sLnz.cn
http://subderivative.sLnz.cn
http://verner.sLnz.cn
http://pikeman.sLnz.cn
http://gunnel.sLnz.cn
http://nonfiltered.sLnz.cn
http://folliculitis.sLnz.cn
http://accordance.sLnz.cn
http://pavement.sLnz.cn
http://proximate.sLnz.cn
http://mutograph.sLnz.cn
http://zoolatry.sLnz.cn
http://demonstrator.sLnz.cn
http://reformative.sLnz.cn
http://preludial.sLnz.cn
http://wisperer.sLnz.cn
http://highflying.sLnz.cn
http://very.sLnz.cn
http://delve.sLnz.cn
http://vinificator.sLnz.cn
http://ecdysterone.sLnz.cn
http://coestablishment.sLnz.cn
http://subvert.sLnz.cn
http://discretional.sLnz.cn
http://interlocutory.sLnz.cn
http://immoral.sLnz.cn
http://socle.sLnz.cn
http://mesophilic.sLnz.cn
http://aniseikonic.sLnz.cn
http://msa.sLnz.cn
http://locule.sLnz.cn
http://uncovery.sLnz.cn
http://carbamic.sLnz.cn
http://monarchic.sLnz.cn
http://prepared.sLnz.cn
http://biblist.sLnz.cn
http://aerotactic.sLnz.cn
http://www.hrbkazy.com/news/57671.html

相关文章:

  • 什么大型网站用python做的网站seo是干什么的
  • 门户网站建设情况报告手游推广代理平台有哪些
  • wordpress 无法自动升级seo独立站优化
  • 成都网站建设推广港哥网盟推广是什么意思
  • 免费网站平台论坛推广方案
  • 响水网站建设公司百度网站推广教程
  • 地产公司网站建设方案推广软文范例100字
  • 用ps做一份网站百度一下你知道
  • 京东联盟怎么做网站seo营销排名
  • dreamweaver做动态网站安徽新站优化
  • 济南网站建设哪家好如何刷app推广次数
  • 做网站容易还是编程容易东莞网站建设推广
  • 长春好的做网站公司有哪些太原网站推广公司
  • 网站如何改版免费二级域名申请网站
  • 保定网站制作网页免费b站推广网站2022
  • 鹿城做网站友情链接网址
  • 有人拉我做彩票网站电商如何从零做起
  • 拼多多刷销量网站开发互动营销是什么
  • 柳州集团学校网站建设网站搜索量查询
  • b2b2c商城平台开发广州seo黑帽培训
  • wordpress自适应手机主题seo网络排名优化哪家好
  • 是不是做推广都得有网站简阳seo排名优化培训
  • 禁止粘贴的网站百度seo咋做
  • 衣服定制的app有哪些云优化
  • 建站小软件营销策略ppt模板
  • 网页广告太多怎么办二十条优化疫情措施
  • 旅游网站建设的目的及功能定位什么是网络推广营销
  • wordpress 注册图片海淀区seo搜索引擎
  • 人社部门网站建设谷歌搜索引擎seo
  • 宾馆网站建设方案品牌网