Monday, July 9, 2007

Non-determinstic finalization as a Design Pattern

Sounds like an April Fool's Day topic, doesn't it?

Or perhaps your mind is just reeling with the possibilities?

It is really the ultimate race condition; you never know when it will really be called, so it better be synchronized!

Forget for a second that we are talking about finalization, but you really do want that to be thread-safe. Not much tolerance for freeing unmanaged resources multiple times.

Think of it for a second; a system where everything gets constructed, but then nothing happens until things start destructing, and destruct they will!

Don't be afraid to abuse your garbage collector. Lock away, allocate more; let your conscience be your guide....

1 comment:

cwrichards said...

Yeow Christ! This sounds like part of the Patriot act.

Disclaimer

Look, this is humor, so put away the flame-thrower! Just have a laugh and go on your merry way....