2

Aeron の LowLatencyMediaDriver サンプルで new Threadfactory() をセットアップできません。VisualVM のスレッド名については、以下のコードとスナップショットを参照してください。

public class LowLatencyMediaDriver {
    public static void main(final String[] args) {
        loadPropertiesFiles(args);

        ThreadFactory conductorThreadFactory = new ThreadFactoryBuilder().setNameFormat(LowLatencyMediaDriver.class.getName()+"-Conductor-%d").setDaemon(true).build();
        ThreadFactory receiverThreadFactory = new ThreadFactoryBuilder().setNameFormat(LowLatencyMediaDriver.class.getName()+"-Receiver-%d").setDaemon(true).build();
        ThreadFactory senderThreadFactory = new ThreadFactoryBuilder().setNameFormat(LowLatencyMediaDriver.class.getName()+"-Sender-%d").setDaemon(true).build();

        final MediaDriver.Context ctx = new MediaDriver.Context()
            .termBufferSparseFile(false)
            .threadingMode(ThreadingMode.DEDICATED)
            .conductorThreadFactory(conductorThreadFactory)
            .receiverThreadFactory(receiverThreadFactory)
            .senderThreadFactory(senderThreadFactory)
            .conductorIdleStrategy(new BusySpinIdleStrategy())
            .receiverIdleStrategy(new BusySpinIdleStrategy())
            .senderIdleStrategy(new BusySpinIdleStrategy());

        try (MediaDriver ignored = MediaDriver.launch(ctx)) {
            new ShutdownSignalBarrier().await();
            System.out.println("Shutdown Driver...");
        }
    }
}

ここに画像の説明を入力

4

1 に答える 1