How vert.x is single threaded?

java, multithreading, single-threaded, singlethreadmodel, vert.x

Solution

Vert.x is not single threaded like node.js. In vert.x you have to differentiate between Verticles and WorkerVerticles. One Vert.x instance will create several event loops (which are threads), usually one per CPU-core. The Verticles will be assigned to an event loop and will always be executed by the same thread, but only if there is work to do. The WorkerVerticles will be assigned to a thread coming from the worker pool and can be executed by different threads. What makes programming fun with Vert.x is the fact that you can "pretend" it is single threaded. You do not have to care about concurrency because you cannot share variables between verticles. Each verticle runs in its own classloader and you can only share data via the event bus. (There is also a shared map but that is distracting in this case.)

Problem

From my understanding, each vert.x instance will be assigned an event loop. Event loop handles all the request an other task for that particular instance. Event loop is a thread, I think. When there are multiple vert.x instance deployed, each instance have there own event loops right? That means there are multiple thread(multi-threading) exists. This is how I understood. This single-threading concept causing me so much headache. Any help will be appreciated.

Original source