LMAX ディストラプターを使用して、プログラムの 1 つによって生成されたコンテンツをバッファリングし、それらをレコードのバッチとして別のプログラムに公開しようとしました (まあ、まだ消費者のバッチ処理の部分を完了できません)。ただし、レコードのバッチ処理を使用しなくても、正常に機能します。しかし、私の問題は、私が使用したにもかかわらず
`disruptor.shutdown()` and `executorService.shutdownNow()`
例の 1 つに示されているように、プログラムの実行は停止しません。これらのメソッドの下のステートメントも実行します。印刷するとき
executorService.isShutdown();
true を返します。誰かがこれで私を助けることができます...
編集
"pool-1-thread-1" prio=10 tid=0x00007f57581b9800 nid=0x1bec waiting on condition [0x00007f573eb0d000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000d9110148> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at com.lmax.disruptor.BlockingWaitStrategy.waitFor(BlockingWaitStrategy.java:45)
at com.lmax.disruptor.ProcessingSequenceBarrier.waitFor(ProcessingSequenceBarrier.java:55)
at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:123)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)