Static's blog

  • Archive
  • RSS

iPhone 4.0 Hope: Background Tools via launchd

balanon:

quatermain:

A lot of people want to run apps in the background on the iPhone, but I believe that Apple has some very legitimate concerns about the feasibility of doing so, at least on the current hardware platforms. However, I believe that there is a perfectly valid way of accommodating most developers’ background-execution needs. This system is called ‘launchd’, and I believe it would provide a very good means of allowing certain tasks to run in the background under the control of various system policies enforced by Apple.

In Snow Leopard, there are some new APIs designed to allow general purpose applications to install background tools used for privilege elevation; these APIs make use of code signing rules to verify that the installing application and the privilege tool match one another (i.e. they must both securely authenticate against one another). The details of this API are in the ServiceManagement framework in 10.6: look at ServiceManagement/ServiceManagement.h, specifically the SMJobBless() function.

This functionality could be used on the iPhone to provide authorized installation and management of user-based (NOT privileged!) background tools, which could be run under a specific launchd instance designed to keep these tasks under control. The launchd environment could also be limited in the functionality it provides: rather than allowing background processes to always run, or to launch and stay alive, it could allow only for launch-on-demand semantics with the requirement that a process keep checking in as it processes data in order to be kept alive beyond a certain threshold. This launchd instance could also throttle the number of such processes running at any one time, or coalesce received data to avoid launching background processes too often (process creation is a lot of work, after all).

This way we could write applications which can perform some small amount of networking on a timed basis (such as pinging a Basecamp server once per hour to check whether updates are required), or could handle Push Notifications in the background, storing received data in a temporary file ready for the real application to handle upon its launch. This last could be useful for twitter-type applications, for example: direct messages could result in a prompt, while @mentions could be dumped quietly to disk so the foreground application can pick them up without waiting for a network connection when it is launched.

Lastly, due to the use of code signing to pair the two processes together, an additional level of security/control is gained by the system, since any attempt to modify either the foreground or background application would result in its code signature becoming invalid. This can then be used as a flag by the system not to allow background processing either way: if either foreground or background signature is invalid, the background process will NOT be launched, EVER.

Pairing this technique with the app store approvals process should guarantee that abuses are kept to a minimum whilst providing developers with some very useful functionality.

Source: quatermain

  • 2 years ago > quatermain
  • 222
  • Comments
  • Permalink
  • Share
    Tweet

222 Notes/ Hide

  1. estantres reblogged this from quatermain
  2. targeted-traffic reblogged this from quatermain
  3. referencement-caen reblogged this from quatermain
  4. realestatede reblogged this from quatermain
  5. 1200-calorie-diet-tips liked this
  6. natural-health-products liked this
  7. pdfsearch liked this
  8. lifecell-reviews liked this
  9. freevideogamewallpapers liked this
  10. shorttermcarinsuranceuk reblogged this from quatermain
  11. mac-games-download reblogged this from quatermain
  12. mac-games-download reblogged this from quatermain
  13. shorttermcarinsuranceuk reblogged this from quatermain
  14. hot-to-seo reblogged this from quatermain
  15. andrewgus01 reblogged this from quatermain
  16. bug-repellent reblogged this from quatermain
  17. bug-repellent reblogged this from quatermain
  18. cake-shops reblogged this from quatermain
  19. cat-adoptions reblogged this from quatermain
  20. chinese-herbal reblogged this from quatermain
  21. chinese-herbal reblogged this from quatermain
  22. food-for-baby reblogged this from quatermain
  23. quick-foods reblogged this from quatermain
  24. quick-foods reblogged this from quatermain
  25. soda-drinks reblogged this from quatermain
  26. soda-drinks reblogged this from quatermain
  27. toys-for-dog reblogged this from quatermain
  28. bed-bugs-kill reblogged this from quatermain
  29. asvab-test reblogged this from quatermain
  30. asvab-test reblogged this from quatermain
  31. coffee-espresso-machine reblogged this from quatermain
  32. color-for-hair reblogged this from quatermain
  33. color-for-hair reblogged this from quatermain
  34. new-jersey-seo reblogged this from quatermain
  35. chiropractic-seminars reblogged this from quatermain
  36. haircuts-styles reblogged this from quatermain
  37. driving-practice-test reblogged this from quatermain
  38. driving-practice-test reblogged this from quatermain
  39. make-yogurt reblogged this from quatermain
  40. kids-swing-set reblogged this from quatermain
  41. dishes-dinnerware reblogged this from quatermain
  42. dishes-dinnerware reblogged this from quatermain

Recent comments

Blog comments powered by Disqus
← Previous • Next →

About

I post random tidbits and cool stuff. Sometimes stuff pertaining to my life.

Me, Elsewhere

  • @staticsafe on Twitter
  • shinobi815 on Youtube
  • staticsafe on Last.fm
  • My Skype Info
  • staticsafe on github
  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr