My advice on implementing stuff in C:
My advice on implementing stuff in C:
Posted Oct 21, 2010 22:01 UTC (Thu) by nix (subscriber, #2304)In reply to: My advice on implementing stuff in C: by mjthayer
Parent article: Russell: On C Library Implementation
Yes, it is. It's really the only sensible thing to do. If you want to do something more complex than die on malloc() failure, do it in a parent monitor process: anything else is too likely to be unable to do whatever the recovery process is, because, well, you're still out of memory. (Bonus: overcommit and the OOM killer work fine with this model, as long as your monitor process is much smaller than the OOMing one, which is very likely. It's even more certain to work if the monitor oom_adj/oom_score's itself away from being OOM-killed.)
