CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2002
    Posts
    5

    Callback Function Problem

    I'm using WINSNMP API to develop a SNMP-based tool. I have encounter some problem with the CALLBACK funtion. As far as i concern, each CALLBACK funtion will create a new thread, but some of the threads create by the callback will not end. It appears to me as a blocking situation. I would like to ask how can force the callback functions(threads) to end?







  2. #2
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    Re: Callback Function Problem

    There are two types of threads, worker threads and user-interface threads.

    Worker threads perform a task then end.

    User interface threads have message pumps and remain active until they get a WM_QUIT message, just like applications.

    But only worker threads use a callback function. However this callback function could contain synchronisation functions (WaitForSingleObject, WaitForMultipleObjectsEx) and could contain a loop, so they do not actually terminate until such-and-such event has happened.

    I don't know exactly what the situation is with your model.

    The best things come to those who rate

  3. #3
    Join Date
    Apr 2002
    Posts
    5

    Re: Callback Function Problem

    for my situation...its up to the implementation(Winsnmp API) to close the thread...there is something i want to verify...is the callback function a thread function itself?or its just a function that is called by a worker thread in background?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured