Git Product home page Git Product logo

Comments (8)

audreyt avatar audreyt commented on August 10, 2024

Yes. We (and the bson copy we include) need to adopt nan: https://npmjs.org/package/nan

That involves re-copying-over https://github.com/mongodb/js-bson/tree/master/ext and adjusting src/*.cc to use NAN APIs.

Volunteers very much appreciated!

from node-webworker-threads.

senditu avatar senditu commented on August 10, 2024

Is anyone working on nan integration? I tried my hand at it, but I'm not familiar enough with v8 to pull it off, I'm afraid. I'd really like to use this library on 0.11.x for one of the project I'm working on...

from node-webworker-threads.

audreyt avatar audreyt commented on August 10, 2024

Not at the moment — I'd like to use ethercalc with pm2 as well (pm2 only really works on Node 0.11.x), but I'd probably want to wait till 0.11.x stabilizes into 0.12.0 before tackling this issue.

One good news is that js-bson has adopted nan a couple months ago; perhaps you could help integrating their code here first?

from node-webworker-threads.

senditu avatar senditu commented on August 10, 2024

I submitted a pull request for integration of the latest js-bson.

from node-webworker-threads.

audreyt avatar audreyt commented on August 10, 2024

Awesome! Released as 0.4.12 on NPM.

from node-webworker-threads.

senditu avatar senditu commented on August 10, 2024

So, I got a build working with all of the nan stuff integrated into it. The code compiles and works properly on Node 0.10.27. The code compiles properly on Node 0.11.12 (both Windows and Linux), but I'm getting an error message back from V8.

# Fatal error in HandleScope::HandleScope
# Entering the V8 API without proper locking in place

I believe I traced the problem down to the aThread function, specifically the following code:

 if (useLocker) {
    //printf("**** USING LOCKER: YES\n");
    #if (NODE_MODULE_VERSION > 0x000B)
        v8::Locker myLocker(thread->isolate);
    #else
        v8::Locker myLocker(thread->isolate);
    #endif
    //v8::Isolate::Scope isolate_scope(thread->isolate);
    eventLoop(thread);
  }

It seems that just using locker on the isolate like before isn't doing the trick for Node 0.11. Any help would be appreciated, as I'm not that familiar with v8. See the following link for the code:

https://github.com/senditu/node-webworker-threads/blob/449d82c72e413fb37e895105db8c22b15ce5b027/src/WebWorkerThreads.cc

from node-webworker-threads.

caasi avatar caasi commented on August 10, 2024

I tried to migrate the code to nan 1.1.0, then I got this problem: nodejs/nan#165.

After I fix that problem with some dirty code, I got this message after finishing test.ls:

FATAL ERROR: v8::HandleScope::CreateHandle() Cannot create a handle without a HandleScope

from node-webworker-threads.

caasi avatar caasi commented on August 10, 2024

I solved that problem by adding NanScope() to destroyThread().

from node-webworker-threads.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.