SimpleDateFormat thread problems?
Bryce McKinlay
mckinlay@redhat.com
Mon May 10 17:53:00 GMT 2004
I suspect part of the problem is possibly broken/slow stack trace code
trying to call external programs to do a calling-classloader check.
Could you try this patch? It should fix the performance bug, but it
seems strange that it would cause your thread to hang. Particularly if
the problem only occurs in a threaded environment, it may be that there
are thread race/synchronization problems with your code. Make sure you
are synchronizing your threads correctly.
Bryce
Vladimir Leven wrote:
> This is a bit vague, but maybe someone on this list will have some
> insights...
>> I have some simple Java code that runs in two threads. One thread runs
> a command line interface. Another thread runs a job scheduler. The job
> scheduler has a method that returns some stats as a string (e.g.
> scheduler start time, number of jobs processed so far, etc...). From
> the command line thread, I can ask for these stats. It seems that
> after asking for stats a few times, the job scheduler thread hangs,
> i.e. every time I ask for the stats, I get the same result. If I
> remove the SimpleDateFormat code that prints the date information in a
> human-readable way, this problem seems to go away. The stats command
> also runs noticeably faster.
>> Thanks for any help...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libjava-dateformat-resource.patch
Type: text/x-patch
Size: 1937 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20040510/e13593ea/attachment.bin>
More information about the Java
mailing list