On Apr 15, 2015, at 9:04 AM, Ryan Schmidt <[email protected]> wrote:
> On Apr 15, 2015, at 2:31 AM, Zhang Chao wrote:
> 
>> node.js version: 4d9c81b7e2522c5d5d9d35058cbb0bce1228d360 (latest version), 
>> v0.10.33, node-v0.12.2
>> Platform: Ubuntu 14.04.1 LTS
>> Architecture: x86_64
>> 
>>    var block = require('bindings')('hello'); // c++ addon
>>    var a = function() {
>>      var timer = (new Date()).getTime();
>>      console.log('before block:'+timer);
>> 
>>      block.hello(); // will be block at some time
>> 
>>      timer = (new Date()).getTime();
>>      console.log('after block:'+timer);
>> 
>>      setTimeout(a, 5000);
>>    };
>>    a();
>> 
>> In the above script, function a will be executed very 5000 milliseconds if 
>> the block.hello is not blocked; But if the block.hello is blocked in c++ 
>> code, the time point which function a will be executed again is much larger 
>> than 5000 milliseconds after block.hello is unblocked.
> 
>> How to fix?
> 
> I think the fix must be for block.hello() not to block.
> 


You forgot a smiley, I hope.

        —ravi

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/23096A23-F5D7-430C-811E-3912823B9A04%40g8o.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to