Dev Language/JAVA
-
java.util.concurrentDev Language/JAVA 2017. 1. 13. 09:34
출처 : 7가지 동시성모델 ReentrantLock과 java.util.concurrent.atomic을 이용하면 스레드가 다음과 같은 일들을 수행 할 수 있기 때문에, 내재된 잠금잠기가 안고 있는 제한을 극복할 수 있다. 잠금장치를 얻고자 기다리는 과정을 가로챌 수 있다. 잠금장치를 기다리는 동안 타임아웃이 발생할 수 있다. 잠금장치를 얻고 반납하는 동작이 임의의 순서로 일어날 수 있다. 임의의 조건이 참이 되는 것을 기다리기 위해 조건 변수를 사용할 수 있다. 원자 변수를 이용해서 잠금장치를 사용하는 것을 피할 수 있다. Java.util.concurrent 패키지에서 제공하는 도구들을 이용해 동시성 코드르 쉽게 만들 수 있을 뿐만 아니라 프로그램을 더 안전하고 효과적으로 만들 수 있다. 스레드를 직..
-
Java Memory ModelDev Language/JAVA 2017. 1. 11. 13:50
Java Memory Modelhttps://en.wikipedia.org/wiki/Java_memory_modelJSR-133(Java Specification Request 133)JSR-133 FAQ : http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#reorderingWhat is a memory model, anyway? Do other languages, like C++, have a memory model?What is JSR 133 about?What is meant by reordering?What was wrong with the old memory model?What do you mean by incorrectly sync..
-
interface 상속, Collection, MapDev Language/JAVA 2011. 1. 3. 14:43
interface 상속 Set, List, Map 등 Collection interface의 상속을 X -> 객체의 생성과 override method의 실행 순서가 꼬일수 잇음 -> 데이터의 일관성 훼손 대신 필요성이 있을때 wrapper class ----- Collection interface : 배열과 달리 서로 다른 type의 자료를 가질수 잇으며, size 동적 할당가능 |- list innterface : |- stack(FIFO) |- Vector(AutoUnBoxing, AutoBoxing) └ ArrayList(동적 메모리) |- Set interface : 순서 의미 X, Data 중복 X, 중복인지 체크하는 method 추가 : equalsa(Object o) └ HashSet Ma..
-
javaDev Language/JAVA 2010. 12. 21. 17:10
java HotSpot VM - use a two machine-word obnject header(cf: 3 word in the classic VM) - to reduce space consumption (the average java object size is small) -> 보통 8% heap size 줄임 - first header : identity hash code and GC status information - second header : a reference to the object's class GC - fully accurate collector http://download.oracle.com/javase/1.3/docs/guide/performance/hotspot.html ja..