I have 3 function and want execute each on new thread using Python
Each function just a math operations.
I need to start each function in each core of process. In Java it's look like:
Thread threadF1 = new Thread(f1);
Thread threadF2 = new Thread(f2);
Thread threadF3 = new Thread (f3);
threadF1.start();
threadF2.start();
threadF3.start();
And if i have 4 cores my program uses 75% of CPU.
I wrote this in Python:
thread = Thread(target = F1, args=(N,))
thread.start()
thread2 = Thread(target = F2, args=(N,))
thread2.start()
thread3 = Thread(target = F3, args=(N,))
thread3.start()
but it uses just 25%. How force working code in Python using 3/4 cores?