Skip to content

Does QuickJS support multithreading? #53

@ShubhamPatil007

Description

@ShubhamPatil007

I have a function written in JavaScript. I have created a callback in C++ as following:

void callbackFunction( int val ) {
   try {
      auto cb = (std::function<void(int val)>) context.eval("run");
      cb(val);
   }
   catch {
      ...
   }
}

I want to put callbackFunction() on a thread, std::thread(callbackFunction, val).detach(). But this always end up with terminate called after throwing an instance of 'qjs::exception'

How can I use multithreading in quickjs? Is there any workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions