> For the complete documentation index, see [llms.txt](https://bohans.gitbook.io/ji-chu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bohans.gitbook.io/ji-chu/ji-chu-zhi-shi/java-bing-fa/xian-cheng.md).

# 线程

{% hint style="success" %}
**线程是比进程更轻量级的调度执行单位，线程的引入，可以把一个进程的资源分配和执行调度分开，各个线程既可以共享进程资源（内存地址、文件 I/O 等），又可以独立调度。**
{% endhint %}

## 线程的创建

通常，有三种使用线程的方法：

1. 实现 Runnable 接口
2. 实现 Callable 接口，作为 FutureTask 的参数
3. 继承 Thread 类
