- 浏览: 121407 次
- 性别:
- 来自: Singapore
文章分类
- 全部博客 (112)
- Tiger Thread (18)
- Perforce (6)
- Spring (5)
- maven (3)
- log4j (3)
- Quartz Scheduler (4)
- unix and linux (12)
- hibernate (3)
- Enum (1)
- Futures and Options (1)
- Market Making (2)
- Java Basic (11)
- Tibco EMS (3)
- F I X message (5)
- equity derivative (2)
- Sybase (3)
- XML (1)
- JUnit (2)
- J A X B 2.0 (1)
- N I O (1)
- windows batch file (1)
- Cruise Control (1)
- util Class (5)
- ant (1)
- JMS (1)
- profiling (0)
- Sql Server (6)
- GXT (2)
- eclipse (1)
- Generics (1)
- Tibco RV (3)
- Autosys (0)
- Message (1)
最新评论
-
houzhe11:
<property name="proxyTa ...
AOP usage -- BeanNameAutoProxyCreator usage
yield() :
Give a hint to the thread scheduling mechanism that, you’ve done enough and some other thread might as well have the CPU. And this is really a hint --- there is no guarantee that your implementation will listen to you! And this hint takes the form of the yield() method.
In general, yield( ) is useful only in rare situations, and you can’t rely on it to do any serious tuning of your application.
join():
a.join(); a will run first, the thread who call a.join(); will block, until a finished running.
Code example: for(int i = 0; I < 5; i++) newSleepingThread().join();
The difference between yield() and sleep()
yield() means release the CPU immediately, I just give up the use of CPU, I give somebody else to use CPU. But I didn’t go to sleep.
sleep(ms) means I will go to sleep for ms million seconds. I may waked up by somebody else(if somebody call myThread.interrupt();), so this is an exception! Need to be surrounded by try catch. wait() is quite similar in this scenario.
Just remember: don’t control the execution order using sleep() or yield(), there is no way to control using sleep() and yield() methods.
Daemon threads:
A daemon thread is one that is supposed to provide a general service in the background. It’s not part of the main application. So, when all the non-daemon threads complete, the program is terminated.
发表评论
-
javadoc for Cyclic Barrier
2009-04-24 12:48 848java.util.concurrent.CyclicBarr ... -
Delayed interface and Delay Queue
2009-04-22 17:42 1000/** * A standard implementati ... -
Count Down Latch example code
2009-04-22 10:38 1089Key point : 1) 1 task is co ... -
3 ways to break dead lock
2009-04-21 17:30 7031) supply special resources. ... -
Blocking Queue Usage
2009-04-20 11:21 7953 implementations: LinkedBlocki ... -
The usage of Lock and Condition
2009-04-18 12:31 1038//: concurrency/waxomatic2/WaxO ... -
Re entrantLock usage
2009-04-15 17:15 1290a thread can be really interru ... -
new interrupt in java5
2009-04-15 12:08 634In Java 5, Thread.interrupt() i ... -
interrupt
2009-04-15 10:57 7641) Each thread has a boolean in ... -
Executor Service Usage
2009-04-14 18:18 861ExecutorService exec = Executor ... -
Thread Local usage
2009-04-14 17:46 760ThreadLocal usage – from Javado ... -
Timer TimerTask usage
2009-04-14 12:03 688Timer typical usage new Tim ... -
wait, notify及线程通讯机制
2009-02-26 22:42 8041) wait(), notify() 方法被调用的时候,只要 ... -
Count Down Latch explanation
2008-10-02 10:29 897Very important paragraph on how ... -
Scheduled Executor Service
2008-07-22 11:27 1060Executor can return Executor, E ... -
Executor usage
2008-07-22 11:04 843Executor is used to arrange thr ... -
Callable Usage
2008-07-22 10:24 884The important thing need to loo ...
相关推荐
PPT about CE6 system architecture and basical knowledge.
第一章Visual Basic 6.0程序设计概述 第二章面向对象编程基础 第三章VB语法基础 第四章基本程序结构 第五章数组 第六章子程序和函数 第七章程序调试和错误处理 第八章窗体(Form)和简单的输入输出 ...
code part 2 for c++ computer programming about basical code.
用C++实现的简单dilation 以及 erosion操作
数字签名基础jar
matlab转换java代码车辆检测 用于视频帧中车辆检测的OpenCV Python程序 人脸检测基础 所给出程序的目的是检测视频帧中的感兴趣对象(汽车)并保持跟踪同一对象。 这是一个如何在Python中检测车辆的示例。...basical
Basical Concept for DNS
the basical guideline of rf network performance optimization
data structure lecture - 4, teach you about basical introduction.
this docoument is for the basical perl code to deal with the normal bioinfromatics questions, which include translate DNA sequences or something else.
A new heuristic algorithm-ant colony optimization and its basical theory are introduced in this article to solve the complicated and optimized questions.This method simulates the course of ant ...
Algorithm-betterdocs.zip,Web版的https://github.com/khusnetdinov/ruby.basical repo-带有Ruby示例和参考的基础编程。它涵盖了线程、实体原理、设计模式、数据结构、算法。供阅读的书。,算法是为计算机程序高效、...
用visual basical 自己编的一个有限元先程序,只够初学者入门
static $basical = array(0=>"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"); static $advanced=array(1=>"拾","佰","仟"); public static function ParseNumber($number){ $number=trim($number); if ...
是用vb做前台,sql做后台的宿舍管理系统论文