3

Android 앱에 1 분마다 시작하도록 예정된 인 텐트 서비스가 있습니다. 이 인 텐트 서비스를 intentServiceA.class라고합니다.여러 개의 IntentServices가 병렬로 실행 중입니다.

이제 특정 작업에 다른 intentService (intentServiceB.class)를 사용하고 싶습니다.

내 질문은 :

합니까 intentServiceB이 intentServiceA의 동일한 스레드에 간다? 대기열에 들어가 있습니까? 또는 별도로 수행합니까?

같은 스레드에 있다면 좋은 대안은 무엇입니까?

도움 주셔서 감사합니다.

답변

3

intentServiceA 및 intentServiceB는 별도의 스레드를 생성합니다. 즉, intentServiceA로 전송 된 인 텐트는 하나의 스레드에서 순차적으로 처리되고 intentServiceB로 전송 된 인 텐트는 다른 스레드에서 순차적으로 처리됩니다.

+0

우선 순위를 변경할 수 있다면 (작업 대기열에서 맨 위로 변경) 작업 대기열이 있는지 여쭈어보십시오. – user1851212

+1

IntentService에는 없습니다. – Okas

+0

ExecutorService를 PriorityBlockingQueue와 함께 사용할 수 있습니다. 예를 보려면 http://binkley.blogspot.fr/2009/04/jumping-work-queue-in-executor.html을 참조하십시오. – Okas