Skip to content

Conversation

@mariuspod
Copy link
Contributor

This PR makes the lib more robust when used in combination with worker_threads.
We've observed that the usage of the global constructor field is not thread-safe and may lead to segfaults.

Fixes issue: #172

Minimal segfaulting example without this change:

const wt = require('worker_threads');
const foo = require('secp256k1');

if(wt.isMainThread) {
  for(let i = 0; i < 100; i++) {
    new wt.Worker(__filename);
  }
}

@fanatid
Copy link
Member

fanatid commented Dec 28, 2022

@mariuspod can you update it as keccak? cryptocoinjs/keccak#24

@fanatid
Copy link
Member

fanatid commented Dec 31, 2022

@mariuspod thank you! I finished PR in #195 and published as v5.0.0

@fanatid fanatid closed this Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants