[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Query on stacktrace management logic
From: |
Chris Gray |
Subject: |
Re: Query on stacktrace management logic |
Date: |
Mon, 1 Mar 2004 11:13:52 +0100 |
Hi all,
I found one gotcha with using a pre-allocated OutOfMemoryError : if several
threads throw OOME at the same time, the stack traces can get mixed up. So
thread A creates a structure, thread B overwrites A's pointer, and then
whatever happens next will be bad news.
This situation is less improbable than you might think, since if one thread
encounters an OOM situation, all other threads should encounter one too.
With some forms of co-operative multi-threading you may get away with it, but
in the general pre-emptive case you could be living dangerously.
--
Chris Gray /k/ Embedded Java Solutions
Embedded & Mobile Java, OSGi http://www.kiffer.be/k/
address@hidden +32 3 216 0369