ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am constantly finding the "handler" keyword in the linux source. I thought it had only to do with interrupts (interrupt handlers,etc), however i see it in other forms,too; for example "Call the commit handler in the driver". Is "handler" a more general naming convention? To what does it usually refer to? So far i have understood, that it generally refers to functions, which finish certain jobs. If you can point me to any links ...
Thanks
Last edited by kpachopoulos; 11-09-2005 at 01:17 PM.
I have never seen "handler" refer to anything except a function that's called to, well, handle something. Usually an event or signal that's called asynchronously.
In c++ terminology (can also be in c) , a handler (also called an exception handler) is a piece of code that manages program events : it catches the event and reacts to it.
Similarly (as being said) you can also have signal handlers. You tell your program that whenever a signal appears, it has to be treated by sig_handler. Then all the error/signal/events/.. are handled in the same function.
The same applies for an interrupt, as yous said. When an interrupt is raised, the handler deals with it, does the action and returns.
A handler can also be an overclass. Rather than using directly a door, you will use the handle to open the door. In that way a handler can also be a helper and this helper can be reused for other objects ( a trunk, a window,..) , it centralizes the entry for an action.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.