3 ms·
LLVM. Easiest way to write your own compiler pass. However, it's going to be tricky to handle ownership between threads as those are not intrinsic to most lang
by Gladdyu 11y ago
LLVM. Easiest way to write your own compiler pass.
However, it's going to be tricky to handle ownership between threads as those are not intrinsic to most languages and therefore not native for the compiler, instead they are just a call to a linked in function (fork/clone/pthread_create/std::thread). Compilers for are unaware that the function actually invokes a system call which performs 'odd' (spawning a new thread) behaviour for a function. So in order to have some notion of 'ownership' by a thread you'd need to recognize all different ways of spawning a new thread for the different operating systems and platforms your compiler should support.