R
Roedy Green
I'm still confused ! I don't have much experience in thread programing.
Best way, I guess would be to write a "proof of concept" program which
should indicate that this little piece of code is thread safe or not. I
would like to run this on all JVMs.
It is very difficult to debug thread code. You have to become paranoid
and simply imagine all possible horrible things that could happen and
make sure you have them covered. You can never test enough to cover
all possibilities, especially all possibilities on different hardware,
platforms, oses.
The keys are:
1. keep the threads from meddling the same variables.
2. don't do raw thread/synchronized/wait/notify code. Use classes
that encapsulate that logic. See the concurrent package e.g. Queue
http://mindprod.com/jgloss/queue.html