Click here to Skip to main content
15,898,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Decoding video C program and want to split it into 4 independent blocks and want each block to run thread on different CPU CORE (have 4 cores)
I am facing troubles in allocating each thread to its corresponding CPU that i chose
i have found library <sched.h> that contains fct sched_getcpu() that returns the cpu numbers that is running but i cannot know my desirable fct
any one could help??
i just need to know the fct that could help me
thanks
Posted

1 solution

May I suggest you read about OpenMP[^].
 
Share this answer
 
Comments
mhd77 25-Mar-11 5:40am    
i have read about openMP its problem that threads are distributed on cores randomly, i want static scheduling the key i found was in the <sched.h> library and the fct was sched_affinity(parameters);
i think this is better way for parallelizing1!!
Niklas L 25-Mar-11 6:04am    
Do you have real-time constraints on you program? That is probably the only time static scheduling might be beneficial, i.e, worth the trouble.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900