Android Process Scheduling

后端 未结 3 1966
鱼传尺愫
鱼传尺愫 2020-11-30 19:56

I am trying to get a better understanding so I can scope the reliability impact from potential interoperability issues when creating an android app/service. I would like to

3条回答
  •  感动是毒
    2020-11-30 20:29

    Yes, it's possible for your process to be starved.

    Android uses Linux 2.6 for its low level management of resources. Linux 2.6 happens to use multi-level feedback queues as its scheduling algorithm. This favours I/O bound processes and short CPU burst processes (ideal for phones for responsiveness/interaction). This does however mean that CPU intensive processes and low priority processes risk getting starved. I'm not sure if Linux 2.6 periodically increases the priority of waiting processes so they will eventually get served thereby avoiding starvation.

    Realistically though, you shouldn't need to worry about this since you will either be the active activity or you will be a service, both of which have relatively high priorities as the previous answer shows.

提交回复
热议问题