Models of concurrency in nodejs

后端 未结 3 827
时光说笑
时光说笑 2020-12-05 09:48

Does anyone know what the memory and threading models are in nodejs?

In particular, is ii++ atomic? Does it behave as if ii were vola

3条回答
  •  旧巷少年郎
    2020-12-05 10:22

    A good article that explains what is, and is not, asynchronous in node.js is Understanding the node.js Event Loop. If you can understand that you will be able to identify where your application has async behavior and where it doesn't. By understanding this you can explicitly write sequential code when you need it. EventEmitters are key.

    Singlethreadedness sounds at odds with the idea that node.js is high performance and scalable so have a look at this article from Yahoo on Multicore.

提交回复
热议问题