From c7c22e3db1c826bcfb2bc66651ec480aae0d4ae0 Mon Sep 17 00:00:00 2001 From: yo mama Date: Sat, 4 Apr 2015 01:00:59 -0700 Subject: first --- .../webworker-threads/test/test28_puts_nextTick_loop.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 node_modules/webworker-threads/test/test28_puts_nextTick_loop.js (limited to 'node_modules/webworker-threads/test/test28_puts_nextTick_loop.js') diff --git a/node_modules/webworker-threads/test/test28_puts_nextTick_loop.js b/node_modules/webworker-threads/test/test28_puts_nextTick_loop.js new file mode 100644 index 0000000..513406f --- /dev/null +++ b/node_modules/webworker-threads/test/test28_puts_nextTick_loop.js @@ -0,0 +1,14 @@ +var i= parseInt(process.argv[2], 10) || 2; +var pool= require('webworker-threads').createPool(i); +console.log("Using "+ i+ " threads."); + +function program () { + var i= 0; + function ƒ () { + puts(" ["+ thread.id+ "]"+ (++i)); + thread.nextTick(ƒ); + } + ƒ(); +} + +pool.all.eval(program).all.eval('program()'); -- cgit v1.2.3-70-g09d2