java并发编程3-线程运行原理

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial 栈 每个线程都有自己的栈, 线程上下文切换 CPU时间片用完 gc 有更高优先级的线程要运行 线程自己sleep,yield,wait,join,park,synchronized,lock     阅读全文
fightinggg's avatar
fightinggg 4月 10, 2020

java并发编程2-创建和运行线程

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial 使用Tread创建线程123456789101112131415161718192021package com.wsx.test;import org.junit.Test;import org.slf4j.Logger;import org.slf4j.LoggerFactory;public class ThreadTest { @Test public void test1() { final Logger logger = LoggerFactory.getLogger(ThreadTest.class); Thread thread = new Thread() { @Override public void run() { logger.debug("running"); } }; thread.setName("t1"); thread.start(); logger.debug("running"); }}     阅读全文
fightinggg's avatar
fightinggg 4月 10, 2020

java并发编程1-进程与线程

nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial Where from 快来点我 进程 一个活动的程序,是程序的实例,大部分程序可以运行多个实例,有的程序只可以运行一个实例     阅读全文
fightinggg's avatar
fightinggg 4月 09, 2020