Did a TON of shit and broke the system with pthread locks. Now it works in theory though (minus parallelization).