inflearn logo
강의

Course

Instructor

Virtual thread in spring boot completed in 1 hour

summary

pinned 확인법

409

adoda

3 asked

0

https://github.com/openjdk/jdk/pull/17221

이런 내용이 있네요. -Djdk.tracePinnedThreads 보다 JFR 을 권장하는 것 같습니다.

java spring-boot 동시성 thread virtual-thread

Answer 3

1

alstjrdl9511790

덧붙이자면, -Djdk.tracePinnedThreads와 open jdk 23 이하에서 제공하는 JFR 이벤트는 성격이 다릅니다.

-Djdk.tracePinnedThreads는 pinning이 일어나자 마자 stack trace가 찍힙니다. 하지만 jdk 21 이하에서 제공하는 JFR 이벤트는 후행 이벤트[1]입니다. pinning이 일어난 로직이 끝나야 이벤트가 출력됩니다. open jdk 24 이상부터는 -Djdk.tracePinnedThreads를 JFR로 완전히 대체할 수 있다고 해야 더 명확할 것 같습니다[2]. 물론 작성자님이 올리신 것 처럼 -Djdk.tracePinnedThreads를 권장하진 않습니다[3]. 다만 이를 대체할 기능이 크게 없네요😅

 

[1]

jdk.VirtualThreadPinned indicates that a virtual thread was parked while pinned, i.e., without releasing its platform thread (see above). This event is enabled by default, with a threshold of 20ms.
https://openjdk.org/jeps/444

[2]

A jdk.VirtualThreadPinned event is recorded by JDK Flight Recorder (JFR) whenever a virtual thread blocks inside a synchronized method. This event has been useful to identify code that would benefit from being changed to make less use of synchronized methods and statements, to not block while inside such constructs, or to replace such constructs with java.util.concurrent locks.
https://openjdk.org/jeps/491

[3]

As regards jdk.tracePinnedThreads. We want this system property to go away, it's just unfortunate that it seems to be widely used.

https://github.com/openjdk/jdk/pull/17221#issuecomment-1874211812

0

Hello World

https://docs.oracle.com/en/java/javase/21/core/virtual-threads.html#GUID-2BCFC2DD-7D84-4B0C-9222-97F9C7C6C521

위 oracle guide 에는 명확히 적혀있지 않아서 저도 잘 몰랐네요. 제보 감사합니다.

0

communityai8509

안녕하세요, 인프런 AI 인턴입니다.

제공된 정보에는 질문하신 내용과 관련된 내용이 포함되어 있지 않습니다. 다른 질문이 있으시면 도움드릴 준비가 되어 있습니다.

동일성 동등성

0

8

1

안녕하세요 치킨 디도스 이벤트 보고 흉내내보려 들어왔습니다..

0

12

1

47번 리턴 관련 질문

0

18

1

실무 내용 문의드려요

0

24

2

IO활용-회원관리예제1 샘플코드 문의

0

19

1

join에대해 질문드립니다.

0

19

1

pg사가 있다고 가정하면

0

25

1

코드 질문

0

25

1

중급 1편 학습 방향에 대해 조언 부탁드립니다

0

32

1

To-Do App

0

27

1

twitterdb 연결이 안돼요

1

27

2

강의노트 접속 불가

0

28

2

Kafka Cluster 구성도 질문

0

23

1

시큐리티 필터 설정 질문입니다!

2

47

1

강의가 싱크가 안맞는것 같아요..

0

30

1

26년 1회차 기출 강의

0

54

2

임포트 오류

0

34

2

기출문제

0

55

1

정보처리기사 실기 zip

0

44

2

답을언제쯤받아볼수있나요

0

49

2

ThreadPoolTaskExecutor에서의 가상스레드

0

277

2

1강 성능비교 질문

0

358

1

스케쥴러 질문드립니다

0

316

2

Performance 테스트에서 CPU 작업도 Virtual이 빠른것 같습니다

0

356

1