//Use our own threads to make the mapping easier,
//and to illustrate the technique of customizing threads.
//For generic Thread objects, could use an unsynchronized
//HashMap or other Map,
//Or use ThreadLocal if JDK 1.2 is available
//We use the num instance variable of the CounterTest
//object to determine which array we are going to increment.
//Sonce each thread is different, here is no conflict.
//Each thread updates its own counter.
long[] arr = vec[((CounterTest) Thread.currentThread()).num];
arr[key] += amount;