1. We're working on a Java project that makes extensive use of
threads, thread control, etc. We're using OS X, several Linux
versions, and numerous Windows variants for development and
testing. Everything looks good so far, but we haven't, at least
to the best of my knowledge, tested the product against machines
using 2 (or more) processors...probably because they cost so
much. We also have tested our products against machines with
varying CPU speeds (for OS X, 400M PPC up to the latest, FWIW, but
it's all single processor, unless you want to call the dual core
Intels "dual processor"...and I really don't know if that
comparison is fair). The question is quite simple: Could running
the program on a dual (or quad) machine expose problems that
weren't transparent under a single processing machine, or does the
JVM see these mutliple processors as a single entity and control
the threads accordingly? THE MORE I THINK ABOUT THIS ISSUE, THE
MORE IT FRIGHTENS ME!!!
Don't be frightened. The OS takes care of the dual processor, and
the JVM doesn't act any differently on single or dual processor
machines. I run Java on dual processor G5s every day, and I also
run Java on dual processor G5 cluster nodes in parallel. I also
run the exact code on a Windoze laptop. No problems.
It may be true that the JVM does not behave differently, depending on
what you mean by "behave differently", but running on a
multiprocessor machine can expose thread bugs which you might not see
on a single processor machine. (But note, as Shawn Erickson said, a
dual core machine is a multi-cpu machine.) The reason is because,
contrary to very early versions of Java (1.0? maybe 1.1? I don't
remember), the more recent JVM's pass off creation and scheduling of
threads to the underlying OS. Remember 'green threads'? It's even
possible, and in fact quite common, to see different thread behavior
on different OS'es (Windows vs. Linux vs. Sun vs. OS X) even when
keeping the number of processors the same. Or even on different
versions of the same OS on the same hardware.
Rob
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden