内存战力强制修改

back_recharge
zhangshanxue 2019-09-18 21:15:38 +08:00
parent 63a587862c
commit 5fd1e90b8a
1 changed files with 68 additions and 34 deletions

View File

@ -24,10 +24,8 @@ public class InnerMessageUtil {
*/ */
public static void broadcastWithRandom(AyyncWorker ayyncWorker, List<Integer> sendId, int timeBound) throws InterruptedException { public static void broadcastWithRandom(AyyncWorker ayyncWorker, List<Integer> sendId, int timeBound) throws InterruptedException {
ExecutorService executorService = Executors.newFixedThreadPool(1);
executorService.execute(new Runnable() { ThreadManager.getScheduledExecutor().schedule(() -> {
@Override
public void run() {
try { try {
int lastUid=0; int lastUid=0;
for (Integer id : sendId) { for (Integer id : sendId) {
@ -55,11 +53,47 @@ public class InnerMessageUtil {
handlerThread.addAyyncWorker(ayyncWorker); handlerThread.addAyyncWorker(ayyncWorker);
lastUid =id; lastUid =id;
} }
}catch (Exception e){ }catch (Exception e){}
e.printStackTrace(); }, MathUtils.randomInt(timeBound), TimeUnit.SECONDS);
}
} //
}); //
// ExecutorService executorService = Executors.newFixedThreadPool(1);
// executorService.execute(new Runnable() {
// @Override
// public void run() {
// try {
// int lastUid=0;
// for (Integer id : sendId) {
// User userInMem = UserManager.getUserInMem(id);
// if(userInMem == null){
// continue;
// }
// ProtocolsManager instance = ProtocolsManager.getInstance();
// if(lastUid!=0){
// HandlerLogicThread handlerThread = instance.handlerThreads[lastUid % instance.HANDLER_THREAD_NUM];
// int retryTimes = 30;
// while ( !handlerThread.ayyncWorkerConcurrentLinkedQueue.isEmpty()){
// Thread.sleep(50);
// retryTimes--;
// if(retryTimes<0){
// System.out.println("fail fail ---------------------->>>>>fail..");
// return;
// }
// }
// Thread.sleep(50);
// }
// HandlerLogicThread handlerThread = instance.handlerThreads[id % instance.HANDLER_THREAD_NUM];
// ayyncWorker.setTask(true);
// ayyncWorker.setUser(userInMem);
// handlerThread.addAyyncWorker(ayyncWorker);
// lastUid =id;
// }
// }catch (Exception e){
// e.printStackTrace();
// }
// }
// });
} }