Is it a problem if two threads *read* it at the same time? Is anything being modified?
------------------------------------- Jeppe Nejsum Madsen<[email protected]> wrote: Timothy Perrett <[email protected]> writes: > The whole Date class in Java is not thread safe. We considered swapping to > JodaTime and I know DCB was working on it, but im not sure from the top of my > head if he ever committed / merged what he was working on... > > Cheers, Tim > > On 11 Jan 2010, at 20:10, aw wrote: > >> See: http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html> >> --------------- >> 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. >> --------------- >> >> >> Since SimpleDateFormat is not thread-safe, do I potentially have a bug >> when using TimeHelpers? >> >> For example, see the Chat.scala example -- see "line" where it binds >> "when" -> hourFormat(c.when)... Is there a potential problem there >> that multiple threads will be running the snippet and accessing the >> same underlying SimpleDateFormat? Yes, I think it's a typo that hourFormat is a val an not a def (like the rest of the formats) /Jeppe -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
-- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
