inflearn logo
강의

Course

Instructor

Virtual thread in spring boot completed in 1 hour

summary

pinned 확인법

413

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 인턴입니다.

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

setter 사용하지 않기

0

7

1

27:15 break 출력

0

8

1

세션을 제대로 이해한게 맞는지 궁금합니다

0

8

0

55강 파이썬에만있는 연산자들

0

18

2

55강의 파이썬에서만 있는 연산자들

0

20

2

안녕하세요 토비님 혹시 완성된 코드의 repository 주소는 없을까요?

0

19

1

강의 영상 업로드 질문

0

25

2

자막 오타 제보

0

25

1

운영환경에 적용해볼 수 없을때...고민입니다 ㅠㅠ

0

27

1

13 섹션 병렬 스트림 고급 1탄 매치 문의

0

34

2

rabbitmq에 configservice 연결에 대해 질문있습니다.

0

29

1

지식공유 (윈도우 설치) [실습] 외부 MCP Server와 연동한 실시간 날씨 조회 - MCP Client 개발

0

34

1

29강 5:00

0

34

2

자료 다운로드가 안됩니다.

0

32

2

3차원 배열의 인덱스 해석 순서와 3중 반복문 순회 메커니즘에 대해 질문드립니다.

0

26

1

인텔리제이 설정 최신화 관련 확인 부탁 드립니다!

0

43

2

띄어쓰기

0

39

2

공부 순서

1

48

2

claude-squad 실행 시 로그인 및 권한 문제

0

34

2

코딩 문제 사이트 접속 오류

0

28

1

ThreadPoolTaskExecutor에서의 가상스레드

0

279

2

1강 성능비교 질문

0

364

1

스케쥴러 질문드립니다

0

321

2

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

0

357

1