Java????5????ü???
???????????? ???????[ 2017/2/15 10:03:06 ] ???????????? Java ???
	??????????????????????????Java???????????????????????????????????????????????????????????Щ?????????????????????????????????????Щ??????÷????????????????????????????????Thread?????????????????????????????????????????????????????????????????????????????????????в????
	?????????????????????????Щ?????????????????????????????????????????????Java?????????????????Щ?????????????????Щ??????????????????????????????÷???????????????????????????????????????ɡ?
	????????? 1.?????
	?????????е????????????????????????????????????????????Java???????????????????????????”Thread-0″?? “Thread-1″?? “Thread-2″?????????????????????——Thread???????????????????????
	??????????????????????????????
	????class SuchThread extends Thread {
	????Public void run() {
	????System.out.println ("Hi Mom! " + getName());
	????}
	????}
	????SuchThread wow = new SuchThread("much-name");
	?????????setter??????
	????wow.setName(“Just another thread name”);
	?????????????????????????????????????????????????????????????????????á?name?????????????????????????????????231-1????????????Integer.MAX_VALUE???????????????????????????????????????????????????????????????????????????????????null?????????????????????????????”null”???????????
	??????????????????????
	???????????????????????????????????????????????????????????????????????????Щ??“Thread-6″?????????????????????????????б??????????????????????????????????????ID????????????棬???????????????????????????
	????“pool-1-thread-1″ #17 prio=5 os_prio=31 tid=0x00007f9d620c9800
	????nid=0x6d03 in Object.wait() [0x000000013ebcc000]
	????“pool-1-thread-1″????????????ɡ????????????????????????????????????????
	????Thread.currentThread().setName(Context + TID + Params + current Time?? ...);
	??????????????????????jstack????????????????
	????”Queue Processing Thread?? MessageID: AB5CAD?? type:
	????AnalyzeGraph?? queue: ACTIVE_PROD?? Transaction_ID: 5678956??
	????Start Time: 30/12/2014 17:37″ #17 prio=5 os_prio=31 tid=0x00007f9d620c9800
	????nid=0x6d03 in Object.wait() [0x000000013ebcc000]
	???????????????????????????????????????????????????????????ID???????顣??????????????????????????λ????????????
	????2. ????????
	??????????????????????????????????????????????????1 (MINPRIORITY)??10 (MAXPRIORITY)?????????????5??NORM_PRIORITY?????????????????и??????????????????????????ù???????????????????????5????????????????????????????????getPriority()??setPriority()??????????????????????????????????????????????
	?????????????????????
	????????????????е?????????????е???????????????CPU???????????Щ?????????????????????????????????Щ??????????????????????????Takipi?У???????????????????????????????????????????????????????MAX_PRIORITY??????Щ?????????μ???????????????????????????Щ???????????????????????JVM??????????????????????Щ????????????????????
	??????????????棬??????????????????????????????????Java?????????????????????????????????????????????????????Linux?????????“-XX:+UseThreadPriorities”??????????????????????????????????????????????????????顣??Linux??????????????Java??????????????????????е????Linux????1??99??????????????????????-20??20?????????????????趨????????????????????CPU??????????????????????????????????????????????????
	????????? 3.??????洢
	???????????????????????в????ThreadLocal????Thread?????????????????java.lang.ThreadLocal???????????????????洢????????????????????????????????????????洢????????????????????????????????????????????????????????????????????????????Щ???????????????洢??Thread??????????????????????????????????????м???????????????
	????????ThreadLocal?????????????????????????????????????е?????????????????????????????????????????????????????????????????????????????????????????У?ThreadLocal????洢?????????????????????????????????????
	????public static class CriticalData
	????{
	????public int transactionId;
	????public int username;
	????}
	????public static final ThreadLocal<CriticalData> globalData =
	????new ThreadLocal<CriticalData>();
	??????????????ThreadLocal??????????? globalData.set()??globalData.get()?????????????в??????
	??????????????????????
	??????????ThreadLocal?????????洢????ID??????????г???δ????????????????????????????????????UncaughtExceptionHandler???????Thread??????????????????????????????????????е???UncaughtExceptionHandler??????????κ??????????????????????????????????????????????Thread?????????????????????б?????????????????????Щ???????????????????????UncaughtExceptionHandler???????????o?????????????????????????ThreadLocal??
	?????????????????????
	????System.err.println("Transaction ID " + globalData.get().transactionId);
	?????????????Щ??????????м????????????????洢?????????ThreadLocal??????????д?????÷?????????????????????????棬??????????????????????????????????á??????????????????????CPU????????????????????????ThreadLocal???????????????????????????????????????????????????????????????????????????????????????????????????£????????????
	????4. ?????????????
	????????????Thread???????е????????????????????????????????????????????仰??????????????????????????????????????????????????????????????м???????????????????????????ó??????????????????????????????????????????????????е????????????????????????????????????????????????Boolean .setDaemon(true)??.isDaemon()?????????????????????
	????????????????????
	?????????????????????????????????????????????????ó????????????????????????????Щ?鷳?£???????????????????????????????????????????????????????????????????????????????????????????????????????????????????Щ????????????????????????????£???Щ????????????ж???
	
??????
					
					???·???
App??С????H5?????????????????Щ??
2024/9/11 15:34:34?????????????????????????
2024/9/10 11:13:49P-One ???????????????????????????????????????
2024/9/10 10:14:12???????????????????????????
2024/9/9 18:04:26??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44
					
			
								
								
								
								
								
								
								
								
								
								
				
sales@spasvo.com