Log in

No account? Create an account
'Twas brillig, and the slithy toves did gyre and gimble in the wabe [entries|archive|friends|userinfo]

[ website | Beware the Jabberwock... ]
[ deviantArt | the-boggyb ]
[ FanFiction | Torkell ]
[ Tumblr | torkellr ]

[Random links| BBC news | Vulture Central | Slashdot | Dangerous Prototypes | LWN | Raspberry Pi]
[Fellow blogs| a Half Empty Glass | the Broken Cube | The Music Jungle | Please remove your feet | A letter from home]
[Other haunts| Un4seen Developments | Jazz 2 Online | EmuTalk.net | Feng's shui]

[Thursday 21st July 2011 at 11:21 pm]

[Tags|, ]
[Playing |Mirrorshades radio]

The Java HashMap class is not synchronised (and that is explicitly documented). This results in... interesting behaviour if two or more threads try to modify a HashMap at the same time.

Apparently, one of the failure modes is for the put() method to get stuck in an infinite loop.
Link | Previous Entry | Share | Flag | Next Entry[ One penny | Penny for your thoughts? ]

[User Picture]From: olego
Friday 22nd July 2011 at 2:06 am (UTC)
It's easier in C++: since nothing is synchronised, you shouldn't be surprised when you get strange multi-threaded behaviour. That's why we use tons of locks.
(Reply) (Thread)