private int findAPrime() throws Exception
		{
			int numDone=0;
			
			while( true)
			{
				int anInt = RANDOM.nextInt(Integer.MAX_VALUE);
				
				boolean thisIsPrime = true;
				
				int stopPoint = (int) (Math.sqrt(anInt) + 1);
				
				// alternatively, if you want to spin the CPUs
				// do this and comment out the Thread.sleep(...) below
				//stopPoint = anInt;
				
				for( int x=2; x <  stopPoint && thisIsPrime; x++)
				{
					if( anInt % x == 0)
					{
						thisIsPrime = false;
					}
					
					numDone++;
					
					if(numDone % 10000==0)
						Thread.yield();
				}
				
				if( thisIsPrime)
				{
					// this is to simulate doing work if we've used the square root optimization
					for( int x=0; x < 20; x++)
						Thread.sleep(100);
					
					return anInt;
				}		
			}
		}