쉐도잉 연습: 🚫 Java Deadlock Explained: Why Your Code is Stuck 😱 (Beginners Must Watch!) - 영상으로 영어 말하기 배우기

연습 모드 선택

각 모드는 전체 화면 연습실로 열립니다.

146 문장
문장이 너무 짧거나 길면 Edit를 눌러 조정하세요.
1
We have seen deadlock example.
2
We have given the example of the lock.
3
But we are going to read deadlock officially.
4
I will give you a example of how the code looks.
5
We will see deadlock doesn't work.
6
We will see how it will resolve.
7
First of all, what is formal definition?
8
In multi-threading, deadlock is a situation where the threats are always blocked.
9
And they depend on the other side.
10
For example, A and B, A has a pen and a paper.
11
A waits for B, when he gives a paper, then I start to write.
12
B waits for A, when he gives a pen, then I start to write.
13
Just, nothing is wrong.
14
One is waiting for another.
15
So, the work will not be wrong and wait for forever.
16
So, this is a condition called deadlock.
17
Formal, formal.
18
Formal, when it comes to match, the deadlock is called.
19
Mutual exclusion.
20
Sir, our critical section is called, which should be locked.
21
First thing is obvious.
22
Then there will be a wait.
23
Another thing is, Hold and wait.
24
A thread holding at least one resource is waiting to acquire.
25
Obviously.
26
Third thing is no preemption.
27
You can't remove pen or pencil.
28
You can't remove paper.
29
We haven't read this yet.
30
It's circular wait.
31
This is obvious.
32
The obvious thing is, they divide in 4 parts.
33
It's false.
34
But obviously, if someone's mind is bad, then they can ask.
35
Okay, sir.
36
So, theory has happened.
37
Sir, a real life example.
38
I have given you a class pen and a class paper.
39
What is written in pen?
40
Write with pen and paper.
41
It is a method.
42
It is called paper.finishedWriting.
43
Another class is class paper.
44
It is called write with write with paper and pen.
45
And then finish writing method.
46
I am going to show you the functionality.
47
What is written in the upper part?
48
I will go in the upper part.
49
I will make two threads.
50
Task 1.
51
The next thread is task 2.
52
In the main thread, a pen and a paper and the threads are made.
53
Then I will start.
54
I am giving a high level overview.
55
Thread 1 is using pen and is trying to use paper.
56
Thread 2 is using paper and trying to use pen.
57
And it's going infinitely.
58
I will close it to forcefully.
59
The condition is the same.
60
Two threads have two people.
61
One has pen and trying to use paper.
62
The other one has B.
63
The other one has paper and trying to use pen.
64
The solution is not coming.
65
This is deadlock.
66
Now, look at the code.
67
There are two methods, paper, and two threads.
68
Task 1 and Task 2.
69
We will create the object in that two objects.
70
Pen and paper.
71
Similarly with Task 2.
72
When we create the object in Task 2, we will create the object in the constructor.
73
Obviously, one pen will be and one paper.
74
So, two people are.
75
Thread 1 and Thread 2.
76
There are two things.
77
One pen and one paper.
78
Thread 1 is written in the first one.
79
One person has pen.
80
Pen.Write with pen and paper.
81
The other person has paper.
82
Now we are going to pen and paper class.
83
Pen has two methods.
84
Write with pen and paper and finish writing.
85
Paper has two methods.
86
Write with paper and pen and finish writing.
87
Pen has been written in thread 1.
88
Synchronize is put.
89
When a method is declared by synchronized keyword,
90
this method will acquire the intrinsic lock of the object the method belongs to.
91
Pen will acquire the method.
92
Pen will acquire the method.
93
And then, paper.finish writing.
94
This method will need paper and pen,
95
so it comes to paper and pen.
96
and he is trying to run pen.finish writing.
97
When will it run pen?
98
When it has a pen lock.
99
What do you mean?
100
It depends on the other one.
101
What is thread 1?
102
It has a pen.
103
And trying to use paper.
104
Similarly thread 2 is using paper and trying to use pen.
105
But nothing is happening.
106
Then we close it.
107
What is deadlock?
108
If it has not been done, then see it again.
109
I am saying it again.
110
Now I need to resolve this, I need to resolve this, deadlock is not necessary.
111
So what can I do?
112
There are many strategies.
113
What is common approach?
114
Ensure that all the threats are consistent order to acquire locks.
115
Consistent order means that multiple threats which are required to acquire locks and multiple resources,
116
they should always acquire the resources in the same sequence.
117
Class pen and paper Here is the lock acquired.
118
What is the lock?
119
The pen and paper are the same.
120
We will do the same work.
121
If we change the lock, then the result will be deadlock.
122
Now, Task 1 is going to lock pen and paper.
123
Task 2 is going to lock pen and pen.
124
What do we do?
125
We use the synchronized keyword.
126
We want to lock and pen.
127
We will say Task 2 is going to lock pen and pen.
128
Then, paper can lock.
129
This is the two things.
130
I will put it here.
131
It will make sure that thread 2 is going to lock pen.
132
When you have pen lock, it's a good thing.
133
But pen lock is a thread 1, no matter what you will do.
134
And paper lock will come, because thread to run not.
135
Because thread to run, you should have pen lock, then paper lock will acquire.
136
So, understand how now.
137
If we change ordering, consistent ordering,
138
lock will acquire, we can resolve the deadlock.
139
Okay?
140
Now, keep the tension so much.
141
Keep the tension so much.
142
Sir, we have a small example which we have resolved.
143
That's it.
144
Keep the tension so much.
145
Keep the tension so much.
146
Okay, sir.

앱 다운로드

유창하게 말하는 데 필요한 모든 것

AI 발음 평가문장마다 점수 확인
IPA 발음 연습모든 소리 마스터
단어 학습나만의 단어장 만들기
단어 게임놀면서 외우기
FOR YOU

추천 영상

이 비디오가 영어 회화 연습에 좋은 이유

이 비디오는 초보자도 쉽게 따라할 수 있는 자연스러운 발음과 명료한 설명이 특징입니다. 특히 기술적인 내용을 설명할 때 사용하는 간단한 문장 구조는 IELTS 스피킹 준비에 딱 맞습니다. 복잡한 개념을 "A has a pen and a paper"처럼 쉽게 풀어내는 방식은 영어로 생각하는 습관을 기르는 데 큰 도움이 됩니다. 또한, 발화 속도가 빠르지 않아 shadow speech 연습에 적합하며, 반복적으로 들으면서 발음을 교정할 수 있습니다.

자연스러운 표현을 분석해보자

  • "We have seen deadlock example." : "We have seen..."은 경험을 공유할 때 자주 사용되는 표현으로, 이야기를 자연스럽게 시작합니다. "example" 앞에 관사가 없지만, 구어체에서는 흔히 생략되므로 이를 통해 구어와 문어의 차이를 배울 수 있습니다.
  • "A waits for B, when he gives a paper, then I start to write." : "waits for"와 "when"을 사용해 조건을 명확히 표현하며, "then"으로 결과를 연결하는 구조는 논리적인 이야기를 전달할 때 필수적입니다. IELTS 스피킹에서 논점을 펼칠 때 유용하게 사용할 수 있습니다.
  • "So, the work will not be wrong and wait for forever." : "So"로 결론을 내리는 방식은 대화에서 흐름을 이어갈 때 자주 사용됩니다. "wait for forever"는 "영원히 기다린다"는 의미로, 비유적인 표현을 통해 내용을 더 생동하게 만듭니다.

실전 연습 루틴: 빠르게 실력 UP!

유튜브 영어 공부의 핵심은 반복입니다. 이 비디오를 이용한 연습 방법은 다음과 같습니다. 1. 비디오를 1분씩 재생하며 내용을 듣고 이해합니다. 2. 같은 구간을 다시 재생하며 shadow speech를 시도합니다 (발음과 억양을 최대한 따라합니다). 3. 녹음기를 켜고 자신이 말한 것을 듣고, 원본과 비교해 발음 교정을 합니다. 하루에 10분씩만 하더라도 1주일 후에는 자연스러운 영어 발화가 가능해집니다. 특히 IELTS 스피킹 준비자는 "mutual exclusion"과 같은 기술 용어의 발음도 함께 연습하면 좋습니다.

이렇게 간단한 루틴을坚持하다면 영어 회화 실력이 급격히 향상될 것입니다. 지금 바로 시작해보세요!

이 영상의 문법

화자가 가장 많이 쓰는 문형을 영상 속 실제 표현과 함께 정리했습니다.

문형영상 속 표현
수동태 be + 과거분사 — 누가 하는지보다 무슨 일이 일어나는지에 초점are always blocked · is called · is written
현재완료 have/has + 과거분사 — 과거의 일이 지금도 관련이 있을 때have seen · have given · haven't read

쉐도잉이란? 영어 실력을 빠르게 키우는 과학적 방법

쉐도잉(Shadowing)은 원래 전문 통역사 훈련을 위해 개발된 언어 학습 기법으로, 다언어 학자인 Dr. Alexander Arguelles에 의해 대중화된 방법입니다. 핵심 원리는 간단하지만 매우 강력합니다: 원어민의 영어를 들으면서 1~2초의 짧은 지연으로 즉시 소리 내어 따라 말하는 것——마치 '그림자(shadow)'처럼 화자를 따라가는 것입니다. 문법 공부나 수동적인 청취와 달리, 쉐도잉은 뇌와 입 근육이 동시에 실시간으로 영어를 처리하고 재현하도록 훈련합니다. 연구에 따르면 이 방법은 발음 정확도, 억양, 리듬, 연음, 청취력, 말하기 유창성을 크게 향상시킵니다. IELTS 스피킹 준비와 자연스러운 영어 소통을 원하는 분들에게 특히 효과적입니다.

섀도잉 방법: 단계별 전체 가이드 읽기 →