What are they and how do signals work?

Asked

Viewed 339 times

15

Do they exist only on Unix or also on Windows? If so, what would be the equivalent on Windows system?

  • What is the relationship with Signal Handling?
  • A practical example of a Signal Handling can be any language just to demonstrate the concept.
  • In which cases it is recommended to work with signals in the programming?

1 answer

12


Signals, thus open, can be a lot, even in computing, it seems to be even talking about the term used in operating system signaling. But he exists in hardware (though it is often called an interruption), or in specific concepts or technologies at another level. I do not know if it is so clear the difference of each term.

Knows events? Event is an abstraction on a level just above signaling. So a signal is information that is passed to an algorithm, usually interrupting normal execution in some way to process something that whoever receives the signal defines what to do.

Linux does this whenever it needs to inform an application that something of her interest has happened and she should process it. In general you can choose what to process, and it is common to have to answer that you have done something, or that you will not, or that the signal issuer must continue in some specific way. Linux may not be quite the initial sender, it coordinates the signaling, but another application can release the signal.

Windows has a very similar mechanism, but it doesn’t call signaling. And of course, the details are different. Some people like it better one way or the other.

I don’t usually do low-level programming on Linux so I can’t give too many details, but I know that in a future project I will have to be a star in this, if I get out of the role :) I use a slightly more abstract mechanism in higher-level languages. I’ve done some things on Windows and the signaling occurs through a callback usually called WindowProc() (tutorial).

Maybe even for some compatibility Windows is capable of processing signals similar to Linux, but I’m not sure the context.

Use always comes from the need to indicate for some application, or part of one, that something happened and needs a position of what to do.

One signal list.

Don’t take this as a canonical answer.

  • Maniero you can add a basic example so I can give you the reward?

  • I’ll try, the problem is that the question is half open, can give one that nothing helps.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.