j riv
j riv

Reputation: 3699

Can a pthreads program's race condition crash the OS or X completely?

Or should one first look at the drivers involved (e.g. OpenGL drivers in a game) or the X server, or a kernel bug?

The example case is simple, two threads may be writing the same variable at the same time. Can that trigger such a massive lock up?

Upvotes: 2

Views: 300

Answers (2)

Ben Voigt
Ben Voigt

Reputation: 283634

Absent a bug, that should not crash the OS.

Now, a user-mode program with sufficiently high priority, or executing a denial-of-service attack (possibly unintentionally) can cause the system to hang, but that has nothing to do with race conditions, just the efficiency of generating requests vs the time needed for the X server to process them.

What does the shared variable control? Is it simply used in mathematical calculations, or does it change the path through your code?

Upvotes: 1

paxdiablo
paxdiablo

Reputation: 881423

Of a decent operating system, definitely not. Any threading issues should be isolated to the current process only.

Assuming that process itself isn't inherently dangerous (elevated privileges, kernel mode code and so forth), it should not be able to bring the OS itself down.

Upvotes: 2

Related Questions