javavert.xvertx-verticle

Do java Vertx event-loops share the same thread? Or is it one to one?


This is regarding the java Vertx event loops. Is one thread attached to one event loop ? or can a single thread run multiple event loops?


Solution

  • Usually, the event loop in itself is a separate thread (which should not be blocked). But there can be more than one event loops.

    From the documentation here and here

    Instead of a single event loop, each Vertx instance maintains several event loops. By default, we choose the number based on the number of available cores on the machine, but this can be overridden.

    A Vert.x instance maintains N event loop threads (where N by default is core*2) by default.