The Java™ Tutorials — Concurrency :Joins 插入
2016-02-11 11:23
357 查看
The Java™ Tutorials — Concurrency :Joins 插入
原文地址:https://docs.oracle.com/javase/tutorial/essential/concurrency/join.html
关键点
join定义:t.join()会引起当前线程暂停执行直到t线程执行完毕
join也会抛出InterruptedException
join的等待时间也是不精确的
全文翻译
The join method allows one thread to wait for the completion of another. If t is a Thread object whose thread is currently executing,join 方法可以让一个线程等待另一线程的完成。如果t是一个Thread对象,而且为正在执行的对象,
t.join()
causes the current thread to pause execution until t’s thread terminates. Overloads of join allow the programmer to specify a waiting period. However, as with sleep, join is dependent on the OS for timing, so you should not assume that join will wait exactly
as long as you specify.
会引起当前线程暂停执行直到t线程执行完毕。join的重载允许开发者指定等待时间。然而,同sleep一样,join的实际等待时间同样依赖于操作系统,所以你不应该假定join的等待时长会精确地等于你所指定的时间。
Like sleep, join responds to an interrupt by exiting with an InterruptedException.
类似sleep,join在响应中断时,会退出并抛出InterruptedException异常。
相关文章推荐
- java-模拟tomcat服务器
- MySQL中join语句的基本使用教程及其字段对性能的影响
- SQL 外链接操作小结 inner join left join right join
- SQL语句的并集UNION 交集JOIN(内连接,外连接)等介绍
- C#多线程之Thread中Thread.IsAlive属性用法分析
- 浅谈SQL Server中的三种物理连接操作(性能比较)
- 探究在C++程序并发时保护共享数据的问题
- alert中断settimeout计时功能
- Nodejs实战心得之eventproxy模块控制并发
- oracle中left join和right join的区别浅谈
- MySQL JOIN之完全用法
- mysql多表join时候update更新数据的方法
- SQL中的left join right join
- SQL的Join使用图解教程
- SQL Join的一些总结(实例)
- php 更新数据库中断的解决方法
- union这个连接是有什么用的和INNER JOIN有什么区别
- Android开发笔记之:如何安全中止一个自定义线程Thread的方法
- java thread start()和run()方法简析
- Java中Runnable和Thread的区别分析