Quiz · Multithreading: An Overview · lesson 4 of 12
Quiz — what is wrong with ++counter
What is wrong if two threads run count_up at the same time?
int counter = 0;
void count_up() {
for (int i = 0; i < 100000; ++i) {
++counter;
}
}Subscribe to take the course
The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.