Hi. Can anyone tell me what are call back handlers and how they are useful in Embeded Systems
What are call back handlers
Collapse
X
-
Tags: None
-
A callback handler is a (handler) function whose pointer you pass to another (worker) function which will get called back by the worker function in given situations. Like the compare function you pass to qsort, you have to write a callback handler to do the compare for the objects you are sorting and pass a pointer to it to qsort which then calls it as required to perform the sort.
Asking how callback functions are useful in an Embeded System is a bit like asking how the for statement is useful in an Embeded System. There is no specific instance of them being useful they are just a general construct available to the C programmer. -
Look at this link:
Callback (computer science) - Wikipedia, the free encyclopedia
Good examples are,
creating thread using pthread library,
ajax,
signal handlers.
Regards,
AshComment
Comment