없는 것만

  • 홈
  • 방명록

thread 2

Java ArrayList, Map multiThread

읽기만 하면 Thread safe하나 수정하면 문제 발생 그래도 multi thread환경에서는 안 쓰는 편이 낫다고 한다. ArrayList, HashMap Thread safe 읽기, 쓰기 가능 CopyOnWriteArrayList, SynchronizedList ConcurrentHashMap, SynchronizedMap Thread safe 읽기만 가능 대신 원본에 접근가능하면 원본은 수정할 수 있음 unmodifiableMap unmodifiableList Google Guava 불변 immutablemap immutablelist JAVA 9 불변 list.of() unmodifiablemap vs immutablemap https://stackoverflow.com/questions/226..

Lang/Java 2023.02.12

Thread Runnable 사용 시 setName

public class ThreadTest { public static void main(String[] args) throws InterruptedException { //1번 Thread thread1 = new Thread(new Worker("11")); Thread thread2 = new Thread(new Worker("22")); //2번 //thread1.setName("A2"); //thread2.setName("B2"); thread1.start(); thread2.start(); } private static class Worker implements Runnable { private String name; public Worker(String name) { this.name = n..

Lang/Java 2023.02.11
이전
1
다음
더보기
프로필사진

없는 것만

과거의 나야 고맙다

  • Info (79)
    • Lang (29)
      • Delphi (6)
      • Python (1)
      • Java (18)
      • Javascript (4)
    • DataBase (3)
    • Server (1)
    • Spring(Boot) (1)
    • Algorithm (9)
      • Codility (6)
      • HackerRank (3)
    • Tools (9)
    • ETC (12)
      • IT (5)
      • 잡다 (7)
    • MY (15)

Tag

java windows service, PASCAL, SimpleTrigger, VS Code, 중복데이터삭제, 이클립스, TortoiseSVN, SpringBoot, LoaclDateTime, mariaDB, thread, DateTimeFormatterBuilder, 갤럭시워치, STS, Delphi, Codility, Java, 카톡, hackerrank, 갤럭시워치7,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/05   »
일 월 화 수 목 금 토
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 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바