Do you have a question? Post it now! No Registration Necessary
- Antti I.
July 22, 2003, 7:33 am
rate this thread
Re: signal handler problem
Signals can be "lost" because each signals state is represented by a
signle bit in a processes task control block. Each time the linux
scheduler selects a process for execution during a time slice, it first
check the signal bits in the TCB and preforms the appropriate action
based on the signal state, and the requisite signal masks. Since many
other processes may run between any two slices in which a signaled
process runs, its possible for the same signal to be sent to a process
multiple times before it is processed. Since a single bit records the
fact that a signal was sent, any duplicate signals are effectively lost.
This isn't really a problem, just a design point you need to code
to. If you want to use signals that are queued (so that none are lost),
you may want to investigate real time signals. They effectively work
the same way regular signals do, but the kernel will queue them for a
process so that 2 sent signals cause the signal handler to be called
twice. Be careful though, real time signals have their own design
pitfalls. Since signal handlers are executed before any other
application code in your program, you may find other processes can
cripple your program by sending too many signals.
- » Using DMA to service externel peripherals(FIFO) in PXA255 Processor
- — Next thread in » Embedded Linux
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux