Hi All;
I am trying to understand the code of the transactional benchmark --
dequeue, and the mechanism in dequeue that binds a thread to a
processor is not clear to me. It seems in the code that the pthread
attr is set to SYSTEM_SCOPE rather than the default processor scope
and that's all that makes the pthread bind to a processor.
By looking around on the Web, in HW2 of cs 838 by Prof. Mark Hill,
the example code shows that there is an explicit call for binding
pthread to processor as the following:
/* ********************** Thread Initialization
*********************** */
/* Bind the thread to a processor. This will make sure that each of
* threads are on a different processor. ProcessorIds[threadId]
* specifies the processor ID which the thread is binding to.
*/
ret = processor_bind(P_LWPID, P_MYID, ProcessorIds[threadId], NULL);
But the example code uses a different compiler than the dequeue
benchmark, could this be the cause or there is something missing in
the dequeue benchmark?
The example code can be found on the following link:
http://www.cs.wisc.edu/~markhill/cs838/Fall2005/handouts/eg_pthread.zip
Some explaination for the example code can be found on the following
link:
http://www.cs.wisc.edu/~markhill/cs838/Fall2005/handouts/hw2.html
Thanks for any reply in advance.
Regards
James
|