我想实现一个心跳机制,其中子进程将定期 ping 父进程以告诉父进程它还活着。我用 threadPool 的 scheduleWithFixedDelay 方法实现 ping 任务:
pingService.scheduleWithFixedDelay(new PingGroomServer(umbilical,
taskId), 0, pingPeriod, TimeUnit.MILLISECONDS);
脐带是RPC客户端到父进程吗?
scheduleWithFixedDelay 可以安排固定延迟吗?在 Stop-The-World GC 期间会停止 ping 线程吗?其实等了 6 * pingPeriod 毫秒后,我还是错过了心跳。