开发者

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

开发者 https://www.devze.com 2023-01-28 17:53 出处:网络
Or should one first look at the drivers involved (e.g. OpenGL drivers in a game) or the X server, or a kernel bug?

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?


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.


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消