Hacker News new | past | comments | ask | show | jobs | submit login

Of course, then you have to deal with resources – like when you unfreeze your app partway through typing a word, but in the meantime the user has changed keyboard layouts, or you unfreeze the camera program but meanwhile something else has been using the camera and left it in a different state.

Better to persist as little as you need, and deal with everything else through clearly defined lifecycles, IMO. Although, I also think programming languages should provide immutable datatypes by default ;).




Good points - except that under iPhone OS 4.0 the OS and apps already have to handle these situations.

Apps compiled for 4.0 are "frozen" when backgrounded. When they are brought to the front, either from the new task pane or their icon, they are unfrozen and restored to a running state. If the iPhone becomes low on memory it terminates frozen apps from least to most recently used.

So since these apps are already suspended, and must deal with a degree of state change when restored, I'm curious why the OS doesn't/can't page their backing store out to flash memory.


Ah true. Maybe they just want to avoid eating into the limited number of writes flash mem handles?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: