뚝딱 뚝딱 개발일기

  • 홈
  • 태그
  • 방명록

2024/11/13 2

[JAVA] 동기화 - synchronized

동시성 문제 발생 테스트package thread.sync;public class WithdrawTask implements Runnable { private BankAccount account; private int amount; public WithdrawTask(BankAccount account, int amount) { this.account = account; this.amount = amount; } @Override public void run() { account.withdraw(amount); }}package thread.sync;import static util.MyLogger.log;import static..

JAVA 2024.11.13

[JAVA] 스레드 제어와 생명 주기2 (Interrupted, yield)

인터럽트 - 시작 1특정 스레드의 작업을 중간에 중단하려면 어떻게 해야 할까?package thread.control.interrupt;import static util.MyLogger.log;import static util.ThreadUtils.sleep;public class ThreadStopMainV1 { public static void main(String[] args) { MyTask task = new MyTask(); Thread thread = new Thread(task, "work"); thread.start(); sleep(4000); log("작업 중단 지시 runFlag = true"); task..

JAVA 2024.11.13
이전
1
다음
더보기
프로필사진

뚝딱 뚝딱 개발일기

  • 분류 전체보기 (91) N
    • 알고리즘 (23)
    • IDEC (1)
      • Intellij (1)
    • 책 (5)
      • Effective Java 3E (2)
      • Real MySQL 8.0 1권 (3)
    • Spring (12)
    • JAVA (37) N
    • JPA (3)
    • CS (3)
    • DB (3) N
    • Network (2) N

Tag

call by value 와 call by reference, 김영한, 행렬곱셈순서, 백준 12886, 다양한 의존관계 주입, 정리해봅시다, 스프링, 프로그래머스, 람다식, 백준11049, 정규식, realmysql, Java, 자바의 신2, 자바의신11~18, equals ==, chain – matrix multiplication problem, 자바, 인프런, 스프링컨테이너,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2024/11   »
일 월 화 수 목 금 토
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바