Albert Solernou, le Mon 30 Jan 2012 12:37:31 +0100, a écrit :
> I am working on a threaded code, and want to bind threads to cores. However,
> the process creates and destroys the threads, so here is the question:
> What happens if I enter on a threaded part of the code, bind "thread X" to
> a core, return to a serial part and then thread again? Can I expect to find
> thread X bound to the core I bound it previously?
It depends on what actually creates the threads. For instance, most
implementations of OpenMP reuse the same kernel threads, without
actually destroying them. But nothing in the standard asserts that, so
you'd probably prefer to re-bind just to be sure.