SimpleDateFormat thread problems?
Bryce McKinlay
mckinlay@redhat.com
Mon May 10 19:19:00 GMT 2004
Vladimir Leven wrote:
> I did try putting "synchronize" keyword around getStats() method, but
> this did not solve the problem of the main scheduler thread hanging.
> Also, it seems to me that synchronization should not be required in
> the first place, since all I am doing is creating a Date from a long
> (which is updated by another thread, but presumably this.time =
> System.currentTimeMillis is atomic?) and then using SimpleDateFormat
> to print it.
As Tom points out, long operations arn't guaranteed to be atomic, but I
think that's unlikely to be the problem here.
> Related question: Is there a way to dump the stack trace for a given
> thread? I can only seem to look at the stack trace for the currently
> running thread.
>
> As for the patch, how do I apply it? Do I have to recompile all of GCC?
Something like:
patch -l -p(n) < file.patch
If you're applying the patch to an already built source tree, you should
just be able to type "make install" and it will only rebuild the parts
of libjava that have changed.
Regards
Bryce.
More information about the Java
mailing list