Saturday, 31 March 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

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...