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? More than one event loop means multi-threading 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.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
(I wrote a reply to your other question (tomcat vs. vert.x), but it didn't show up for some reason.)
When you run a single instance of the jvm with one or more verticles, they will use only one threads,
but it is possible to start worker verticles that use their own threads. Anything that is not running in a worker thread is running in one event loop and will take care of how many requests or whatever operations are happening.
Each verticle is an instance of the verticle class so it can keep its own state, but the actual execution only happens in one at a time (which leads to kind of brain twister problem to understand what is happening when, once your comfortable with that it should be easy to implement code that correctly works with that).
On Thursday, May 29, 2014 3:16:50 PM UTC+2, Ronald Randon wrote: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? More than one event loop means multi-threading 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.
--
Sorry, wasn't aware of that, this makes sense in the way of distributing load of course.
I assume that any verticle will stay in a specific event loop when it is started?
(I wrote a reply to your other question (tomcat vs. vert.x), but it didn't show up for some reason.)
When you run a single instance of the jvm with one or more verticles, they will use only one threads, but it is possible to start worker verticles that use their own threads. Anything that is not running in a worker thread is running in one event loop
and will take care of how many requests or whatever operations are happening.
Each verticle is an instance of the verticle class so it can keep its own state, but the actual execution only happens in one at a time (which leads to kind of brain twister problem to understand what is happening when, once your comfortable with that it should be easy to implement code that correctly works with that).
On Thursday, May 29, 2014 3:16:50 PM UTC+2, Ronald Randon wrote: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? More than one event loop means multi-threading 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.
--
On 29/05/14 18:00, Alexander Lehmann wrote:
(I wrote a reply to your other question (tomcat vs. vert.x), but it didn't show up for some reason.)
When you run a single instance of the jvm with one or more verticles, they will use only one threads, but it is possible to start worker verticles that use their own threads. Anything that is not running in a worker thread is running in one event loop
Each verticle instance maintains several event loops, by default a number equal to twice the number of cores. Those threads are shared out between standard verticle instances in a round robin fashion.
On Saturday, June 14, 2014 6:54:26 AM UTC-4, Tim Fox wrote:On 29/05/14 18:00, Alexander Lehmann wrote:
(I wrote a reply to your other question (tomcat vs. vert.x), but it didn't show up for some reason.)
When you run a single instance of the jvm with one or more verticles, they will use only one threads, but it is possible to start worker verticles that use their own threads. Anything that is not running in a worker thread is running in one event loop
Each verticle instance maintains several event loops, by default a number equal to twice the number of cores. Those threads are shared out between standard verticle instances in a round robin fashion.
Just so no one is confused, he means "Each *vertx* instance maintains several event loops" :)