Parallel programming in java