Prev: Shop online without credit card
Next: ANNOUNCE: Major Feature Release - NHI1-0.7, PLMK-1.6 and libmsgque-4.5
From: Lothar Kimmeringer on 9 Mar 2010 10:36 Mayeul wrote: > Lothar Kimmeringer wrote: >> Roedy Green wrote: >> >>> I have got in trouble with SimpleDateFormat not being thread safe. >> >> How possibly _could_ a SimpleDateFormat be thread safe? > > ? > > What do you mean ? It looks to me if SimpleDateFormat had been designed > immutable, it would make sense to have it thread-safe, as other > languages or libraries have it. I mean, how can you expect it to be thread safe if the Javadoc clearly states | Synchronization | | Date formats are not synchronized. It is recommended to create | separate format instances for each thread. If multiple threads | access a format concurrently, it must be synchronized externally. > Actually, even though its mutable, I would have expected it to be > thread-safe as long as you don't mutate it anymore. Thankfully the > JavaDoc is clear that it's not. Oh well. Ah, you read it (now) ;-) Regards, Lothar -- Lothar Kimmeringer E-Mail: spamfang(a)kimmeringer.de PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81) Always remember: The answer is forty-two, there can only be wrong questions!
From: Roedy Green on 9 Mar 2010 22:10 On Tue, 9 Mar 2010 16:36:35 +0100, Lothar Kimmeringer <news200709(a)kimmeringer.de> wrote, quoted or indirectly quoted someone who said : >I mean, how can you expect it to be thread safe if the Javadoc >clearly states It was quite some time ago I got in trouble. I suppose I thought of a SimpleDateFormat as sort of static final constant, like the string that describes a Regex. -- Roedy Green Canadian Mind Products http://mindprod.com The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time. ~ Tom Cargill
First
|
Prev
|
Pages: 1 2 3 4 Prev: Shop online without credit card Next: ANNOUNCE: Major Feature Release - NHI1-0.7, PLMK-1.6 and libmsgque-4.5 |