Saturday, March 31, 2018

multithreading - What are the differences between event-driven and thread-based server system?


  • Node.js is an event driven I/O and It's a single threaded server that
    acts upon callbacks and never blocks on the main thread.




    1. But how does it manage to non-blocking I/O?

    2. if it does easy to manage, why don't thread-based system manage it?

    3. Does not work the other threads (behind single event-driven thread) as like thread-based ?

    4. if the other threads mean workers(behind event driven thread) are busy, how it still can handle jobs without blocking?



  • Thread-based model assigning a task to a thread and if there is no
    idle thread, block new tasks.




    1. if a thread can handle multiple tasks like as event-driven single
      thread that handles every I/O without blocking, why thread-based
      system doesn't use this tactic on busy threads to I/O without
      blocking.





I am wondering what are the differences (advantages/disadvantages) between event-driven and thread-based server systems.

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...