Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It roughly three weeks I will be taking a Parallel programming class that is taught using C for the assignments. I have a fairly strong interest in the subject at present and my C skills aren't terrible but I feel like I need to brush up on C as the last class I had that actively required programming in it was 8 months ago. I took an Embedded Systems course in the spring so I understand the concept of deadlock, semaphores and the "shared data" problem. It was primarily iOS programming code wise so my C skills haven't seen loads of use from that context either.

If I had to guess as to an area of especially stringent re-study I would select pointers and memory allocation as that seems to be the primary challenge. I believe the class covers MPI and OpenMP so I may take a look at those in advance. Am I on the right track or am I missing something entirely?

share|improve this question

closed as too broad by MichaelT, Bart van Ingen Schenau, Dan Pichelman, Tulains Córdova, Kilian Foth Dec 12 '14 at 13:22

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 3 down vote accepted

You will need threads for concurrent programming, and they are not part of the C language proper. Rather, they are part of the operating system. See here for more information about how to use threads on Unix and Linux.

Now that you're into threading, there is a paper that talks specifically about the problems and pitfalls of concurrent programming using threads here:

The Problem with Threads

share|improve this answer
Threads aren't required for concurrent programming, as long as processes are available. Processes require sharing to be explicit, alleviating many (but not all) of the problems with threads. – Joey Adams Aug 4 '11 at 3:46

After years of hard realtime embedded developemnt, the only advise is that you cannot test the correctness of concurrent / parallel / multitrheaded applications.

The best you can do with test is prove the presence of concurrency issues. Therefore you need to understand where you interactions are happeneing, and prove though design they are robust. The biggest gotcha is not limiting the interactions to the bare minimum needed to do the job, and spinning more threads than needed because it's easy.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.