pthreads程序的竞态条件是否会使OS或X完全崩溃?

时间:2021-07-19 15:13:19

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

或者我们应该先看看相关的驱动程序(例如游戏中的OpenGL驱动程序)、X服务器,还是内核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?

这个例子很简单,两个线程可能同时编写同一个变量。这会引发如此大规模的*吗?

2 个解决方案

#1


2  

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.

假设进程本身并不是固有的危险(提升的特权、内核模式代码等等),那么它就不应该能够降低操作系统本身。

#2


1  

Absent a bug, that should not crash the OS.

如果没有bug,就不会导致操作系统崩溃。

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.

现在,具有足够高优先级的用户模式程序,或者执行拒绝服务攻击(可能是无意的)可能会导致系统挂起,但这与竞争条件无关,只与生成请求的效率和X服务器处理请求所需的时间有关。

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

共享变量控制什么?它是简单地用于数学计算,还是通过代码改变路径?

#1


2  

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.

假设进程本身并不是固有的危险(提升的特权、内核模式代码等等),那么它就不应该能够降低操作系统本身。

#2


1  

Absent a bug, that should not crash the OS.

如果没有bug,就不会导致操作系统崩溃。

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.

现在,具有足够高优先级的用户模式程序,或者执行拒绝服务攻击(可能是无意的)可能会导致系统挂起,但这与竞争条件无关,只与生成请求的效率和X服务器处理请求所需的时间有关。

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

共享变量控制什么?它是简单地用于数学计算,还是通过代码改变路径?