본문 바로가기
[android] background work(AlarmManager) 수행에 대한 이야기 [android] background work(AlarmManager) 수행에 대한 이야기 https://plus.google.com/+AndroidDevelopers/posts/GdNrQciPwqo -구버전 안드로이드에서는 background work 를 위해서 보통 AlarmManager 를 사용했다.AlarmManager 를 사용하면 앱이 foreground 가 아닌 상황에서도 미래 특정 시점에 어떤 일을 하도록 scheduling 을 할 수 있다. -60초 이내에 무언가를 수행하게 하고 싶다면 AlarmManager 는 best choice 가 아닐 수 있다.이 때는 Handler 를 이용해보도록 하자. -API 21+ (5.0 LOS) 부터는 setAlrmClock() API 를 통해서 user.. 2019. 1. 27.
[Kotlin] Coroutine vs. thread (Light-weight thread 가 뭔 말이야?) [Kotlin] Coroutine vs. thread (Light-weight thread 가 뭔 말이야?) https://stackoverflow.com/questions/43021816/difference-between-thread-and-coroutine-in-kotlin -Coroutine 은 stackless, stackful 이렇게 두 가지 type 이 있다.Kotlin 은 stackless coroutine 이다. stackless 이기 떄문에 약간의 기능제한이 있다. -https://www.quora.com/Why-is-it-that-with-a-stackless-coroutine-only-the-top-level-routine-may-be-suspended Stackless corouti.. 2018. 11. 26.
[iOS Study] 병렬 프로그래밍 가이드 ( 병렬 앱 디자인 ) [iOS Study] 병렬 프로그래밍 가이드 ( 병렬 앱 디자인 ) https://developer.apple.com/library/ios/documentation/General/Conceptual/ConcurrencyProgrammingGuide/ConcurrencyandApplicationDesign/ConcurrencyandApplicationDesign.html#//apple_ref/doc/uid/TP40008091-CH100-SW1 -전통적 방법으로의 복수개의 코어를 사용하는 방법은 여러개의 thread 를 만들어 사용하는 것이다.그러나 thread 를 사용한 코드는 scale 측면에서 좋지 않다.core 가 처리하기 좋은 thread 의 갯수를 아는 것도 쉽지 않고, thread 들을 효율적으.. 2017. 7. 1.
[android] Thread Scheduling 에 대한 이야기 [android] Thread Scheduling 에 대한 이야기 -Thread 에는 priority 값을 주어 CPU 사용량을 조절할 수 있다. ( Process#setThreadPriority( int ), Thread#setPriority( int ) ) 이 Priority 에 들어가는 값은 Nice value 라 부르는데, 다른 Thread 에 대해 얼마나 Nice 한가를 나타내는 값이다. Nice 값이 높다는 것은 다른 Thread 에게 많이 양보하는 착한(?)놈이라는 의미. 즉 Nice 값이 높을수록 우선순위가 낮아 CPU 활용이 적어진다. - Android 에서는 Main ( UI ) Thread 가 우선순위가 보통 가장 높아야 한다. BG 에서 도는 Thread 들의 Nice Value 가.. 2015. 12. 22.
반응형