Hacker News new | past | comments | ask | show | jobs | submit login
Crash-Only Software (archive.org)
47 points by raganwald on April 14, 2010 | hide | past | favorite | 7 comments



Apple added a per-process "crash to shutdown more quickly" flag in Snow Leopard:

To support improved shutdown, your application needs to mark itself as “dirty” or “clean,” depending on whether it has unsaved changes and needs to do work before quitting, or can be terminated without further notice. When the system shuts down, clean applications are terminated (via SIGKILL) without further interaction.

http://developer.apple.com/mac/library/releasenotes/MacOSX/W...


Wow, thank you so much.

I have this application (uTorrent) that keeps aborting system reboots because it tries to gracefully close hundreds of connections and lags out. I just added "NSSupportsSuddenTermination" to the plist file, and now it shuts down instantly. No more cancelled reboots!


In practice this works really, really well. I've used it quite a bit in my own internal stuff, but I'd love to see a wider adoption among other developers -- there currently aren't many applications with this support built in (including Apple's own). The dirty/clean marking mechanism is pretty simple; as long as the number of dirty calls equal the number of clean calls, it's considered safe to kill.


It seemed like a good time to raise this again in light of the Mobile Multitasking discussion.

http://news.ycombinator.com/item?id=1264119


See also this article on the topic:

Crash-only software: More than meets the eye by Valerie Aurora

http://lwn.net/Articles/191059/



This paper was one of the main inspirations behind the CouchDB design.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: