Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yennanliu committed Jun 25, 2024
1 parent eadec22 commit 2cd92ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -663,9 +663,10 @@
- thread as an allocation & execution unit, each thread has its independent running thread and counter (pc)
- Multiple threads in the same process CAN USE `same storage unit / memory space ..` -> they allocate instance from the same `heap`
-> but such memory sharing mechanisms may cause `thready safety` concerns.
- `Parallelism (並行) VS Concurrency (並發)`
- `parallel (並行) VS Concurrency (並發)`
- Parallelism : multiple CPUs run different tasks. e.g. multiple people do different stuffs
- Concurrency : One CPU does different tasks (jump between tasks). e.g. one person does different stuffs
- https://github.com/yennanliu/CS_basics/blob/master/doc/faq/java/java_multi_thread.md
- Process
- Thread
- A `thread` is a thread of execution in a program. The JVM allows an application to have multiple threads of execution running concurrently.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/DesignPattern/Singleton/Lazy.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public static void main(String[] args) {

MyClass2 myClass2_1 = MyClass2.getInstance();
MyClass2 myClass2_2 = MyClass2.getInstance();
System.out.println(myClass2_1 == myClass2_2);
System.out.println(myClass2_1 == myClass2_2); // true
}
}

0 comments on commit 2cd92ed

Please sign in to comment.