forked from kesenhoo/android-training-course-in-chinese
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add gitignore, modified 'multi-threads' 😊
- Loading branch information
alex
authored and
alex
committed
Jul 7, 2014
1 parent
ddb5eac
commit 4bc9293
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
> 编写: | ||
> 编写:[zhaochunqi](https://github.com/zhaochunqi) | ||
> 校对: | ||
# 多线程操作 | ||
速度和效能对于一个长期运行的,数据敏感的操作通常会提高当你分成小块操作在多个线程上执行的时候。在一个有多个处理器(核心)的CPU上,系统能够并发的执行多个线程,而不是让每一个子操作等待实际来运行。例如,解码多个图像文件时候为了将他们显示屏幕缩略图运行的显著加快当你让每一个解码运行在分开的线程中的时候。 | ||
|
||
这一课会向你展示如何建立和应用多线程在Android应用中,使用一个线程池对象。你也会学到如何定义代码运行在一个线程中和如何让其中的线程与UI线程交流。 | ||
|
||
## 课程 | ||
|
||
### 在一个线程上运行特定的代码 | ||
学习如何在一个写出在独立线程中运行的代码,通过定义一个类来实现Runnable 接口。 | ||
|
||
### 创建一个多线程的管理器 | ||
学习如何创建一个能够管理线程对象池的类和一系列Runnable对象,这个对象叫做ThreadPoolExecutor | ||
|
||
### 在线程池线程中运行代码 | ||
学习如何在线程池对象中运行一个Runnable线程。 | ||
### 与UI线程交流 | ||
学习如何从线程池中的线程与UI线程交流。 |