Open Jorropo opened 4 years ago
I am running into the same problem. Would be nice to run concurrent tor instance in the future.
@karalabe any update on this problem? I could also try to create a PR if you point me in the right direction
@gtuk this is since all of this code is executed in the same process as go.
The easy fix is for architectures that supports it first fork
, creating 2 process, the main one that continues and a new one to execute tor into and then execute Tor. (like the unix execution model expects), so multiple tor process wouldn't mengle everything.
It might also be possible to remap Tor's global variables into TLS (Thread Local Storage), it's the same idea, isolate the globals, ... but using Thread Specific memory, instead of Process one.
This slightly modified example crash instantly :
Crash like this :
Is this a complete impossibility (such as the tor node using some global objects) or something that can be fixed with a good lock somewhere ?