我的第一篇博客
✅ Day 1:并发基础与线程机制 🔍 一、什么是并发和并行? 概念 解释 示例 并发(Concurrency) 多个任务在同一时间段交替执行 单核 CPU 多个任务切换 并行(Parallelism) 多个任务在同一时刻同时执行 多核 CPU 每个核一个线程 面试点:Java 是支持并发的语言,利用多线程模拟并发行为,但是否能并行,取决于 CPU 核数。 🧵 二、线程与进程的区别 比较点 线程(Thread) 进程(Process) 最小执行单元 是 否(进程可以包含多个线程) 内存空间 共享(如堆、方法区) 独立 开销 小 大 通信方式 共享变量、同步机制 Socket、管道等 👷 三、Java 中创建线程的三种方式✅ 方法一:继承 Thread123456class MyThread extends Thread { @Override public void run() { System.out.println("线程运行:" +...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment