3 ms·
This is how I made my fork of libtcc lock-free. Mainline has a lock so that all backends can use global variables, but only one instance can do codegen at a ti
by rsaxvc 3y ago
This is how I made my fork of libtcc lock-free.
Mainline has a lock so that all backends can use global variables, but only one instance can do codegen at a time.
It was a giant refactoring Especially fun was when multiple compilation units used the same static variable name, but it all worked in the end.
- 72deluxe 3y agoOut of curiosity, where is this fork? Sounds very interesting.
- rsaxvc 3y agohttps://github.com/rsaxvc/tinycc-multithreaded https://github.com/rsaxvc/tinycc-multithreaded This is the multi-threaded compiler: https://github.com/rsaxvc/tcc-swarm https://github.com/rsaxvc/tcc-swarm With the multi-threaded tcc above it scales about as well as multiprocess. With mainline it doesn't scale well at all. So far I haven't gotten around to reusing anything across libtcc handles/instances, but would eventually like to share mmap()'d headers across instances, as well as cache include paths, and take invocation arguments through stdin one compilation unit per line.