Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 크기가 작은 부분 문자열
- green thread
- CPU bound
- 문자열 내마음대로 정렬하기
- CPU
- 동시성문제
- http
- process
- 문자열
- DICTIONARY
- 가장 가까운 단어
- annotation
- java
- 십진수 이진수 전환
- port
- 2차원 배열 출력
- 코딩테스트
- IO bound
- URL
- frontPattern
- Split
- springMVC
- stack
- Queue
- Spring
- 프로그래머스
- deque
- dns
- reflection
- TCP/IP
Archives
- Today
- Total
목록동시성문제 (1)
아무나개발하자

멀티 스레드 동시성 문제를 보여주기 위해 코드를 작성해 보았다. Counter class Counter{ private int state = 0; public void increment(){ state++; } public void get(){ System.out.println("현재 상태는 : " + state + "입니다."); } } state라는 전역변수를 공유해서 사용할때의 문제를 보여주기 위해 작성을 했다. increment() 메소드는 state를 +1해주는 메소드이다. MyThread1 class MyThread1 extends Thread{ Counter counter; public MyThread1(Counter counter) { this.counter = counter; } @Ove..
OS
2023. 1. 14. 11:31