java – vert. How is x single threaded?
According to my understanding, every vert X instances will be assigned an event loop Event loops handle all requests and other tasks for that particular instance I think the event cycle is a theme When multiple verts are deployed When x instances, does each instance have its own event loop? This means that there are multiple threads (multithreading) This is my understanding This single thread concept gives me a headache Any help would be appreciated
Solution
Vert. X is not like node JS that is single threaded In vert In X, you must distinguish between verticles and workerverticles A vert The X instance will create multiple event loops (they are threads), usually one per CPU core Vertical will be assigned to an event loop and will always be executed by the same thread, but only if there is work to be done Worker verticles will be assigned to threads from the work pool and can be executed by different threads Make vert The fact that x programming has become interesting is that you can "pretend" that it is single threaded You don't have to care about concurrency because you can't share variables between verticles Each vertical runs in its own classloader, and you can only share data through the event bus (there is also a shared map, but it can be distracting in this case.)