Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a basic example of "low-level" multi-threading in C++?

I'm a kinda newbie developer with a few years under my belt. Recently I interviewed at a game company and was asked "have you done any multi-threading?" I told them about having a C# app with a few Threads... and then I said a bit about transactions and locking etc in Sql. The interviewer politely told me that this was too high-level and they are looking for someone with experience doing multi-threading in C++.

So what is a basic example of "low-level" multi-threading in C++ ?

like image 737
MrDatabase Avatar asked Oct 13 '08 15:10

MrDatabase


1 Answers

The canonical implementation of "low level threads" is pthreads. The most basic examples of threading problems that are usually taught along with pthreads are some form of readers and writers problem. That page also links to more classical threading problems like producers/consumers and dining philosophers.

like image 170
Ryan Avatar answered Nov 15 '22 11:11

Ryan