Specifically talking about (server side) V8, and assuming I'm not concerned about accuracy because I can detect and compensate for it, could I literally set up thousands of relatively simple timeouts several seconds apart from each other using setTimeout without facing any other limit other than RAM? Is there any catch I should be aware of if I were to use a system where there may be thousands of scheduled timeouts at any given time?
For the record I've read John's Resig excellent article on How Javascript Timers work so no need to point out anything that's already covered there :) I'm aware node.js is single threaded, timers can block other timers if they take too long, etc.
PS: I'm strictly trying to understand how viable is what I describe, no need to point out "there's surely a better way to do what you intend to do!".
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…