Re: boolean and thread safety
Daniele Futtorovic wrote:
In light of things like these, it never ceases to amaze me that our
programs actually work. :)
Although, I would assume that the purpose of many of these dispositions
is actually to cover the tracks for compiler/vm writers and hardware
manufacturers, and that what they describe occurs only exceptionally in
practice. IFF that assumption is correct, how likely are things to go
bad if what before was exceptional becomes, for what reason so ever, the
regular case?
They already have. The changes to the Java memory model with version 3 of the
JLS were a direct response to the increased visibility of concurrency bugs,
most of which had been in production for a while before anyone noticed.
Around 2003 - 2005 (it's fuzzy but I peg it around there) the computer
industry pulled back from the 3 GHz clock-speed limit and started stampeding
into multi-core. With actually separate CPUs handling separate threads,
memory visibility problems became, er, visible.
That said, irrespective of platform and throughout the history of concurrent
computing, concurrency is tricky, on occasion fatally so. Bugs there are by
nature elusive and probabilistic (or, to coin a portmanteau,
"probaballistic"). Conditions extrinsic to the application affect the behavior.
The answer to, "How likely?" is, "It depends."
--
Lew
Honi soit qui mal y pense.