For example, When I multithread a "for loop" using OpenMP, making the iterations as different threads, How does it get translated to Assembly?
Also can a multithreaded code run on hardware supporting multithreading without any OS being involved?
I am trying to understand in the most basic sense, how multithreading code is compiled using the frameworks and how is it run on the hardware?
omp fordoes not create the threads. It only distribute the work to them. Threads are created inomp parallelsections (often even only once since they can be recycled).omp parallel foris equivalent to the sectionomp parallel+omp for. Multipleomp forcan be done in a singleomp parallel section(which is frequent and a good idea).