sleep 1 millisecond stead of 1 namos, avoid thread resource contention.

This commit is contained in:
wusheng 2016-11-28 15:05:45 +08:00
parent 741ec6ac0b
commit 4764e12d99
1 changed files with 5 additions and 2 deletions

View File

@ -23,7 +23,7 @@ public class StorageThread extends Thread {
StorageThread(long count, CountDownLatch countDownLatch, int index) {
listener = new MyStorageClientListener();
client = new Client("127.0.0.1", 34000).newSpanStorageClient(listener);
client = new Client("10.128.34.248", 34000).newSpanStorageClient(listener);
this.count = count;
this.countDownLatch = countDownLatch;
this.index = index;
@ -52,7 +52,10 @@ public class StorageThread extends Thread {
cycle = 0;
while(!listener.isCompleted){
LockSupport.parkNanos(1);
try {
Thread.sleep(1L);
} catch (InterruptedException e) {
}
}
listener.begin();
ackSpanList.clear();