人们说像Javascript这样的单线程语言不能解决这个问题。然而,nodejs提供了cluster来派生多个worker。这会导致race condition问题吗?
另外,我有一个例子,它有时会引起我的困惑:
ALLSESSIONS = {};
//session id saved in cookie
ALLSESSIONS[sessionid] = 'somevalue';
var SESSION = ALLSESSIONS[sessionid];
... do stuff for sometimes
console.log(SESSION);
我担心当当前请求仍在运行