- 浏览: 126935 次
- 性别:
- 来自: 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 904java.util.concurrent.CyclicBarr ... -
Delayed interface and Delay Queue
2009-04-22 17:42 1053/** * A standard implementati ... -
Count Down Latch example code
2009-04-22 10:38 1154Key point : 1) 1 task is co ... -
3 ways to break dead lock
2009-04-21 17:30 7621) supply special resources. ... -
Blocking Queue Usage
2009-04-20 11:21 8333 implementations: LinkedBlocki ... -
The usage of Lock and Condition
2009-04-18 12:31 1069//: concurrency/waxomatic2/WaxO ... -
Re entrantLock usage
2009-04-15 17:15 1320a thread can be really interru ... -
new interrupt in java5
2009-04-15 12:08 658In Java 5, Thread.interrupt() i ... -
interrupt
2009-04-15 10:57 8171) Each thread has a boolean in ... -
Executor Service Usage
2009-04-14 18:18 894ExecutorService exec = Executor ... -
Thread Local usage
2009-04-14 17:46 817ThreadLocal usage – from Javado ... -
Timer TimerTask usage
2009-04-14 12:03 724Timer typical usage new Tim ... -
wait, notify及线程通讯机制
2009-02-26 22:42 8501) wait(), notify() 方法被调用的时候,只要 ... -
Count Down Latch explanation
2008-10-02 10:29 957Very important paragraph on how ... -
Scheduled Executor Service
2008-07-22 11:27 1106Executor can return Executor, E ... -
Executor usage
2008-07-22 11:04 903Executor is used to arrange thr ... -
Callable Usage
2008-07-22 10:24 933The important thing need to loo ...
相关推荐
第一章Visual Basic 6.0程序设计概述 第二章面向对象编程基础 第三章VB语法基础 第四章基本程序结构 第五章数组 第六章子程序和函数 第七章程序调试和错误处理 第八章窗体(Form)和简单的输入输出 ...
计算机视觉是信息技术领域的一个重要分支,它涉及到图像处理、机器学习和模式识别等多个学科的交叉。在计算机视觉中,图像的形态学操作如膨胀(Dilation)和腐蚀(Erosion)是基本且非常有用的工具,尤其在图像分割...
数字签名基础jar
matlab转换java代码车辆检测 用于视频帧中车辆检测的OpenCV Python程序 人脸检测基础 所给出程序的目的是检测视频帧中的感兴趣对象(汽车)并保持跟踪同一对象。 这是一个如何在Python中检测车辆的示例。...basical
Basical Concept for DNS
在IT行业中,编程语言Visual Basic(VB)是一个广泛使用的工具,尤其在开发Windows应用程序时。在给定的压缩包文件中,"Visual Basic读取EXCEL文件含完整源代码"是一个示例项目,展示了如何利用VB来操作Excel文件,...
the basical guideline of rf network performance optimization
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示例和参考的基础编程。它涵盖了线程、实体原理、设计模式、数据结构、算法。供阅读的书。,算法是为计算机程序高效、...
`$basical`数组包含数字0到9对应的中文数字,而`$advanced`数组包含拾、佰、仟等位值单位。这些数组用于在转换过程中查找和组合相应的中文数字和单位。 转换逻辑中的一个关键点是对“零”的处理。在人民币金额中,...
是用vb做前台,sql做后台的宿舍管理系统论文