Thread thread1 = new Thread(new Runnable() {
public void run() {
while (....)
....
}
});
Thread thread2 = new Thread(new Runable() {
public void run() {
while (....)
....
}
});
thread1.start();
thread2.start();