By Stefan Wörthmüller
A crash course tutorial
Today, all programs must parallelize tasks if they are to enjoy the power available through multicore processors. Until recently, though, parallel programming was the domain of server programmers and their scientific counterparts. Now, programmers from other domains are faced with the problem of migrating existing applications from serial to multithreaded architectures.
The good news is that you do not have to migrate your whole application. The migration can be done step by step, and a large portion of the code does not need to be migrated at all: Most programs spend 80 to 90 percent of their runtime in 5 to 10 percent of their code. If your application has 100,000 lines of code, it’s probably sufficient to parallelize 5,000 to 10,000 lines to get most of the lift of parallelism. Still, that’s a lot of work.
This article shows how to introduce multithreading to mature desktop applications written in C and C++. These applications usually have some attributes that make it more difficult to introduce multithreading: They often consist of old code with many nooks and crannies whose functions are undocumented and unknown, or they are GUI applications with a single main thread. Let’s explore how to migrate these applications.



0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
You must log in to post a comment.