Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all friends
how to assign CPU to my program in C# with code.
please help me it's very important for me.

i write a program with C# that compares the Data Patterns which work with databases. and then draw a diagram
that show the number of records that inserted in the database and its time.
now, when i run the program, and draw a diagram it has very undulate, means the diagrams not equal.

Sorry all friends because i can't speak english well.

thanks all

god be with you.
Posted
Updated 13-May-12 21:58pm
v4
Comments
Sandeep Mewara 26-May-11 1:48am    
Can you add on what are you trying to do?
Prerak Patel 26-May-11 1:50am    
Elaborate more. What is your task? What efforts you have made?
Sergey Alexandrovich Kryukov 26-May-11 2:00am    
Please pay attention to your spelling. After all, this is about being elementary polite.
--SA

If you are trying to learn parallel programing,
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=86b3d32b-ad26-4bb8-a3ae-c1637026c3ee&displaylang=en[^]

assign CPU to my program
What do you mean by this? Assigning priority or affinity?
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 26-May-11 1:58am    
OP's question is best interpreted as it's about affinity. Topic of the article you referenced is much wider and shifted from the question, but this material is very good to know, my 5.

I answered exactly to the point, please see.
--SA
Prasanta_Prince 26-May-11 3:49am    
Good one 5 from me.
Please see my detailed answer here:
How to program multicore[^].

With .NET, you can use System.Threading.Thread.BeginThreadAffinity/EndThreadAffinity, for compact Framework — System.Threading.Thread.SetProcessorAffinity.

Again, you can do it if your absolutely sure what are you doing. It can make more hard than good.

Good luck,
—SA
 
Share this answer
 
v2
Comments
Kim Togo 26-May-11 7:39am    
Good answer. My 5.
Sergey Alexandrovich Kryukov 26-May-11 12:47pm    
Thank you, Kim.
--SA

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