On Apr 9, 2012, at 12:34 PM, Jeremy Rudd wrote: > Hi all, > > I've got a couple of long-running functions that use BigIntegers and the like > for some financial calculations. These take a few seconds to execute. Now a > few seconds of CPU on the main node thread means all other activity grinds to > a halt. What's the easiest way to call these functions asynchronously? ie, on > another thread? > > Should I be making a module? Is it possible without a module? Should I be > using child_process? > > Any pointers or tips appreciated. > Thank you.
That's exactly what threads_a_gogo is for: <https://github.com/xk/node-threads-a-gogo> It lets you run these calculations in parallel, in javascript, in threads, and using all the available CPU cores. Then the main thread will receive the results in a callback or via an event. -- Jorge. -- 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 nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en