As multi-core processors become more and more popular, I think it would be wise for me to become familiar with how to write code to take advantage of them. I am a .NET developer, and am not sure where to begin (seriously, I have no clue where to start). Any suggestions?
Multi-core programming is essentially multi-threaded programming. As long as your application is multi-threaded, the operating system will determine which core to run which thread on.
So then, your real question should be, what kind of applications would benefit from being multi-threaded? Think of such an application, then instantiate multiple threads to solve equal portions of the problem.
The best way to start is to grab the latest CTP of the parrallel extensions framework and start plowing through their sample code.
Read up on the asynchronous programming model that .NET uses. Study the BeginXXX and EnxXXX paradigm that allows delegates to execute in the threadpool.
The Stream classes all have BeingXXX, EndXXX methods (eg BeginRead, EndRead) that allow you to do asynchronous IO. If you're working on something that heavily IO based you'll want to use these methods to increase parallelism.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With