6

I did read that signals need to have a separate stack, why and how do you think it is implemented ?

Are they dynamically allocated or statically allocated ? How is memory allocation done ? Is it the same for all signals ?

4

2 回答 2

4

The reason that signals need a separate stack is that, if the normal stack gets corrupted or overflows, the signal can still execute. I think the signal stack is usually allocated dynamically, but it could implemented be either way. You can set a new signal stack with sigaltstack. It is the same for all signals.

于 2009-05-08T20:10:00.200 回答
1

另一个更深奥的原因是创建用户级线程。请参阅 Ralf Engelschall 的论文“便携式多线程”:http ://www.gnu.org/software/pth/rse-pmt.ps 。它描述了如何使用“信号栈蹦床技巧”来影响用户空间线程。

于 2010-01-09T06:08:40.920 回答