Giter Site home page Giter Site logo

Thread pool of pre-loaded VMs about v8-cffi HOT 7 OPEN

nitely avatar nitely commented on May 26, 2024
Thread pool of pre-loaded VMs

from v8-cffi.

Comments (7)

thedrow avatar thedrow commented on May 26, 2024

Doesn't V8 have it's own GIL? What would happen if you initialize multiple VMs inside a process?

from v8-cffi.

nitely avatar nitely commented on May 26, 2024

It's explained in the docs. You can run multiple VMs, each has its own GIL.

from v8-cffi.

thedrow avatar thedrow commented on May 26, 2024

Oh that's really cool. I didn't know that it was possible. If you try to do the same with Python you're going to encounter some nasty issues.

from v8-cffi.

nitely avatar nitely commented on May 26, 2024

Yes, the alternative (in Python) is to spawn a child process. V8's devs could have done the same to work around the GIL, but instead they added the concept of isolate (a VM for all practical purposes) to achieve the same with threads (I dunno why they wanted threads so badly, since with isolates you still share nothing). I think that feature is there to support web workers.

from v8-cffi.

thedrow avatar thedrow commented on May 26, 2024

I thought that it's not possible since in MRI Ruby you are not allowed to use more than one V8 VM in one process.

from v8-cffi.

nitely avatar nitely commented on May 26, 2024

I guess it must be a limitation of the gem (therubyracer?), maybe it's built on top of an older V8.

from v8-cffi.

thedrow avatar thedrow commented on May 26, 2024

Actually ExecJS disallows it and both therubyracer and miniracer don't support it. Kudos on having that already built in.

from v8-cffi.

Related Issues (6)

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.