use child_process if you understand it. it will give you nice async. if not use ffi but will lock the main node process.
On Sun, Mar 16, 2014 at 11:47 AM, Andy Zelinski <[email protected]>wrote: > I am hoping for someone to point me in the right direction (examples, > info) on how best to handle the need for some processor heavy computations > that might best be executed with C++ math libraries. > > example scenario pseudocode: > > 1. application user clicks "give me 10 movies to watch" button after > entering age, iq, time of day, and how much time he/she has to watch. > (some post data needed as calculation parameters) > 2. application pulls some historical data from database: an array of > [person id, age, iq, movie watched, time watched, movie length, rating user > gave] -- say a million data points in an array > 3. application then needs to apply a sophisticated math model to all data > points and includes other hard-coded parameters. > 4. assume after watching one movie, all the hard-coded parameters change > as a side effect, so the algorithm should rank all movies in likelihood > loved from 1 to n, choose the top ranked movie for user, and then iterate > for the next 9, re-applying the math model > > is this best handled by forking a child_process? use node-ffi? wrap a c++ > object that can handle the math and pass the parameters? > > thanks a million > > -- > -- > 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/d/optout. > -- Humankind cannot gain anything without first giving something in return. To obtain, something of equal value must be lost. That is alchemy’s first Law of Equivalent Exchange. ~ Alphonse Elric, Full Metal Alchemist -- -- 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/d/optout.
