본문 바로가기
[Java] Semaphore 에 대해 알아보자. [Java] Semaphore 에 대해 알아보자. https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Semaphore.html -자바 병렬 프로그래밍을 통해 학습한 내용에도 (http://aroundck.tistory.com/867) 세마포어 내용이 있지만, 이번에 실 사용하면서 semaphore 에 더 깊이 알아봐야 겠다는 생각이 들어 학습하면서 몰랐던 내용이나 중요한 것들 위주로 글을 정리해본다. Overview Counting Semaphore 는 특정 자원이나 특정 연산을 동시에 사용하거나 호출할 수 있는 스레드의 수를 제한하고자 할 때 사용한다.Semaphore 클래스는 가상의 Permit 을 만들어 내부 상태를 관리하며, 클래스를 .. 2018. 12. 20.
Efficient Android Threading #3 프로세스 간 통신 Efficient Android Threading #3 프로세스 간 통신 이 글은 Efficient Android Threading 의 일부 내용만 발췌한 내용입니다.자세한 내용은 책을 구입해서 보세용. 5.1. 안드로이드 RPC -안드로이드의 변형 리눅스 커널 안에서, 리눅스 IPC 기술은 프로세스 사이의 RPC 메커니즘을 수행하는 바인더 프레임워크로 대체되었다.이를 통해 클라이언트 프로세스는 마치 로컬에서 메서드를 실행하듯 서버 프로세스의 원격 메서드를 호출할 수 있다. -RPC 메서드 호출 자체는 단순하지만, RPC 매커니즘의 하부는 다음과 같은 단계로 구성된다. 1. 메서드 데이터 분해(마샬링, marshalling)2. 원격 프로세스로 마샬링된 정보를 전송3. 원격 프로세스에 정보를 재구성(언마.. 2018. 3. 19.
[Kotlin] initializer 이야기 [Kotlin] initializer 이야기 https://medium.com/keepsafe-engineering/an-in-depth-look-at-kotlins-initializers-a0420fcbf546 -constructor, initializer 등이 있을 때 적용되는 순서를 아는 것이 좋다. 먼저 constructor 의 default argument 가 가장 먼저 적용된다.그 다음 property initializer 와 init block 이 수행된다. 이 때 수행 순서는 top-to-bottom 으로 정의된 순서대로 수행된다.그 다음에 constructor 가 수행된다. -open class Parent { private val a = println("Parent.a") constru.. 2018. 1. 19.
[Kotlin Tutorial] Annotation 과 Reflection #2 [Kotlin Tutorial] Annotation 과 Reflection #2 참조 : Kotlin in action 10.2. Reflection: introspecting Kotlin objects at runtime -Kotlin 에서의 reflection 은 java.lang.reflect package 의 API 들과 kotlin.reflect package 의 API 들을 사용한다.Kotlin 의 reflection 은 Java 에 없는 nullable type 이나 properties 들의 접근을 가능하게 한다. -runtime lib 의 size 를 줄이기 위해, kotlin 의 reflection API 는 kotlin-reflect.jar 라는 별개의 jar 로 pakcage 되어 있.. 2017. 9. 12.
[Kotlin Tutorial] 람다로 프로그래밍 하기 - Chap5. Programming with Lambdas [Kotlin Tutorial] 람다로 프로그래밍 하기 - Chap5. Programming with Lambdas 참조 : Kotlin in Action 5.1. Lambda expressions and member references 5.1.1. Introduction to lambdas : blocks of code as function parameters 5.1.2. Lambdas and collections -val people = listOf(Person(“Alice”, 29), Person(“Bob”, 31))println( people.maxBy{ it.age } ) // function 을 argument 로 받는다. { } 는 lambda syntax lambda 가 단순 functio.. 2017. 8. 16.
[Kotlin Tutorial] 클래스, objects, 그리고 인터페이스 #2 [Kotlin Tutorial] 클래스, objects, 그리고 인터페이스 #2 참조 : Kotlin in Action 4.3. Compiler-generated methods: Data classes and Class delegation 4.3.1. Universal object methods -Java 에서 == 는 primitive 나 object 의 reference 를 비교하는 것.Kotlin 에서는 == 가 기본비교이다. equals 를 호출해서 비교한다.그럼 Java 에서의 == 는? === 로 대체된다. 4.3.2. Data classes: autogenerated implementations of universal methods -data class Client(val name: Stri.. 2017. 8. 14.
[Kotlin Tutorial] 클래스, objects, 그리고 인터페이스 #1 - Chap4. Classes, objects, and interfaces [Kotlin Tutorial] 클래스, objects, 그리고 인터페이스 #1 - Chap4. Classes, objects, and interfaces 참조 : Kotlin in Action 4.1. Defining class hierarchies 4.1.1. Interface in Kotlin -Kotlin 의 interface 는 Java8 과 비슷하다.abstract method 를 가질수도 있고, Java8의 default method 도 가질 수 있다. ( Java8 과는 다르게 default keyword 는 필요없다 )단, state 는 여전히 가질 수 없다. ( 실제 variable ) -Kotlin 에서 interface 정의는 아래와 같다.interface Clickable{ fun.. 2017. 8. 11.
[Kotlin Tutorial] Kotlin 기초 #1 - Chap2. Kotlin basics [Kotlin Tutorial] Kotlin 기초 #1 - Chap2. Kotlin basics 참조 : Kotlin in Action 2.1. Basic elements : Functions and variables 2.1.1. Hello, world! -fun main(args: Array){ println(“Hello, world!”)} fun 는 function 을 정의하는 keywordtype 은 variable 이름 다음에 옴function이 class 정의 안에 있지 않아도 된다Array 가 class 이다 ( Java 는 아니징 ) -> Kotlin 에서는 모든 것이 Object 이다System.out.println 대신 println; (semicolon) 넣을 필요 없다 ( option.. 2017. 7. 25.
[android] java.lang.NoSuchMethodError: java.io.IOException.<init> - com.google.android.gms.internal [android] java.lang.NoSuchMethodError: java.io.IOException. - com.google.android.gms.internal java.lang.NoSuchMethodError: java.io.IOException. at com.google.android.gms.internal.g.f() at com.google.android.gms.internal.g.b() at com.google.android.gms.internal.e.a() at com.google.android.gms.internal.e.a() at com.google.android.gms.internal.bq.a() at com.google.android.gms.internal.cg$1.run() at.. 2014. 2. 20.
반응형