What are call back handlers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maheshgupta0248
    New Member
    • Oct 2008
    • 14

    #1

    What are call back handlers

    Hi. Can anyone tell me what are call back handlers and how they are useful in Embeded Systems
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    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.

    Comment

    • ashitpro
      Recognized Expert Contributor
      • Aug 2007
      • 542

      #3
      Look at this link:
      Callback (computer science) - Wikipedia, the free encyclopedia

      Good examples are,

      creating thread using pthread library,
      ajax,
      signal handlers.

      Regards,
      Ash

      Comment

      Working...