Final Fantasy
The Spirits Within
Palm Powered
Try Again
William Edward Hickson
do try { … } catch { … } finally { … } while(true);
Pale Blue Dot
A Vision of the Human Future in Space
That’s here. That’s home. That’s us. On it everyone you love, everyone you know, everyone you ever heard of, every human being who ever was, lived out their lives. The aggregate of our joy and suffering, thousands of confident religions, ideologies and economic doctrines, every hunter and forager, every hero and coward, every creator and destroyer of civilization, every king and peasant, every young couple in love, every mother and father, hopeful child, inventor and explorer, every teacher of morals, every corrupt politician, every “superstar”, every “supreme leader”, every saint and sinner in the history of our species, lived there, on a mote of dust, suspended on a sunbeam. The Earth is a very small stage in a vast cosmic arena. Think of the rivers of blood spilled by all those generals and emperors, so that in glory and in triumph, they can become the momentary masters of a fraction of a dot. Think of the endless cruelties visited by the inhabitants of one corner of this pixel, on the scarcely distinguishable inhabitants of some other corner. How frequent their misunderstandings. How eager they are to kill one-another. How fervent their hatreds. Our posturings, our imagined self-importance, the delusion that we have some privileged position in the universe, are challenged by this point of pale light. Our planet is a lonely spec in the great enveloping cosmic dark. In our obscurity, in all this vastness, there is no hint that help will come from elsewhere to save us from ourselves. The Earth is the only world known so far to harbor life. There is nowhere else, at least in the near future, to which our species could migrate. Visit? Yes. Settle? Not yet. Like it or not, for the moment, the Earth is where we make our stand. It has been said that Astronomy is a humbling and character-building experience. There is perhaps no better demonstration of the folly of human conceits than this distant image. To me, it underscores our responsibility to deal more kindly with one another, and to preserve and cherish the pale blue dot, the only home we’ve ever known. — Carl Sagen |
Perspectives
Sorry, The Disassembler Is Broken.
Give Us A Minute To Fix It.
Synchronization
Processes, Threads & Fibers (continued)
Dynamic Static Lifetime Singleton Instance Creation Techniques — Composition & Factory-Managed Inheritance
Fast Unsafe — This technique is acceptable only when used from within the same thread of execution:
private static Thing instance = null;
public static Thing getInstance() {
if (instance == null) instance = new Thing();
return instance;
}
Slow Safe — This technique is completely thread-safe, but incurs a synchronization time penalty each time getInstance() is invoked:
private static final String LOCK = "ThingSyncLock";
private static Thing instance = null;
public static Thing getInstance() {
synchronized (LOCK) {
if (instance == null) instance = new Thing();
}
return instance;
}
Fast Safe — This technique is completely thread-safe, incurring a synchronization time penalty only the first time getInstance() is invoked:
private static final String LOCK = "ThingSyncLock";
private static Thing instance = null;
public static Thing getInstance() {
if (instance == null) synchronized (LOCK) {
if (instance == null) instance = new Thing();
}
return instance;
}
NOTE — Instance deallocation is problematic. If required, it must occur within an identical synchronization block to prevent overlapping instance creation. Beware of destructor dependency deadlocks in the inheritance chain.