뚝딱 뚝딱 개발일기

  • 홈
  • 태그
  • 방명록

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
다음
더보기
프로필사진

뚝딱 뚝딱 개발일기

  • 분류 전체보기 (127)
    • 알고리즘 (24)
    • IDEC (1)
      • Intellij (1)
    • 책 (6)
      • Effective Java 3E (3)
      • Real MySQL 8.0 1권 (3)
    • Spring (17)
    • JAVA (47)
    • JPA (4)
    • CS (3)
    • DB (3)
    • Network (11)
    • docker (5)
    • 객체지향 (2)
    • mongoDB (1)
    • os (0)

Tag

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

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • 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.

티스토리툴바