lundi 12 janvier 2015

Node js working single thread but how fast?

General web platforms like PHP, Java, .Net is using a thread for one request.



CLIENT-------------------------------SERVER

Request1 --------------------------> Thread1 ------>
Request2 --------------------------> Thread2 ------> GO database, file, etc.
Request3 --------------------------> Thread3 ------>


I am reading node js processing model. It is a bit different. But I confused a bit. Request is binding async process by a single thread.



CLIENT-------------------------------SERVER

Request1 --------------------------> Worker1 ---->
Request2 --------------------------> Thread--> Worker2 ----> GO database, file, etc.
Request3 --------------------------> Worker3 ---->


Multiple request should be slower then PHP or Java process. Because multiple request is binding single thread. Is this true?


And second question, is the same thread givind response that coming from worker thread?


Aucun commentaire:

Enregistrer un commentaire