There is actually room with some of the features from upcoming v8 that opens the possibility of running VM contexts in threads relatively safely, though I'm not sure if we'd ever support that as a mechanism to extend cluster.
But the idea of being able to identify cpu bound javascript and run it in a background thread as a first class feature is a very interesting concept that I'm not ready to give up on. That being said, most workloads are decidedly not cpu bound. On Tue, Jan 28, 2014 at 5:56 PM, Alex Kocharin <[email protected]> wrote: > > 27.01.2014, 14:29, "Damian Kaczmarek" <[email protected]>: > > Hi, > I seem to have totally lived in the dark about the existence of the VM > module. > I have two questions that I hope a kind knowledgeable soul could answer > and I could not find the answers in the docs. > > 1) Does the VM module run contexts in separate threads? If not, could it > in the future? > 2) If answer was yes to the previous question, or will be in the future - > could the cluster module be reworked to use separate contexts instead of > processes? > > > > 1. No. No. > 2. No. > > If you want just to scatter vm instances over multiple child processes, > any good node.js developer can came up with such solution in an hour. There > are "sandbox" and a few other modules already doing it (I saw at least one > webworkers implementation based on this). > > As for threads...Why do you want to use threads instead of child > processes? I don't believe it has any performance benefit, and sharing > states between different v8 instances is impossible anyway (read as "nobody > would do that"). > > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
