Search code examples
cmultithreadingmulticore

Can I take advntage of multi core in a multi-threaded application that I develop


If I am writing a multi-threaded C application on linux (using pthreads), can I take advantage of multi-core processor.

I mean what should an application programmer do to take advantage of multi-core processor. Or is it that the OS alone does so with its various scheduling algorithms


Solution

  • You don't need to do anything. Create as many threads as you want and the OS will schedule them together with the threads from all the other processes over every available cores.