This depends on the problem and how you communicate between the threads.
If the threads are independent and don't require any communication, you can just use processes instead of threads. If there is a lot of communication and locking, it will be more difficult, of course. Then you must look into Inter-process communication like shared memory and semaphores.