in reply to On elegant coding...
in thread Just thinking ...
{ ## main loop show_cache_and_exit("current") if cache_is_good(); unless (cache_is_stale()) { ## cache is dead update_cache(),show_cache_and_exit("current") if i_am_the_writer(); ## we cannot do anything about a bad cache, so retry close_cache(); sleep 5; redo; } ## If I'm not the writer then show old cache show_cache_and_exit("stale") unless i_am_the_writer(); ## If I cannot fork it's up to me update_cache(),show_cache_and_exit("current") unless i_can_fork(); show_cache_and_exit("stale") if i_am_the_parent(); ## child does: be_a_child(); update_cache(); exit 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: On elegant coding...
by merlyn (Sage) on Oct 14, 2000 at 08:05 UTC | |
|
RE: RE: On elegant coding...
by runrig (Abbot) on Oct 15, 2000 at 02:25 UTC |