Worker thread questions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • active

    #1

    Worker thread questions

    I'm reading about Threads but there is so much to understand I don't know
    where to spend my time.

    I want a worker thread to populate a list box.

    I'd like:

    The main thread to be able to abort the process if it wants to.
    The contents of the list box to show the progress.

    Do I need to study any or all the following:

    Polling for Asynchronous Call Completion
    Waiting for an Asynchronous Call with EndInvoke
    Executing a Callback Method When an Asynchronous Call Completes
    Waiting for an Asynchronous Call with WaitHandle


    I found many examples but am not sure which one corresponds to my needs.
    Is there an example of what I described?

    Thanks in advance



  • Harry Strybos

    #2
    Re: Worker thread questions

    " active" <activeNOSPAM @a-znet.comwrote in message
    news:efsmQPTfHH A.2216@TK2MSFTN GP03.phx.gbl...
    I'm reading about Threads but there is so much to understand I don't know
    where to spend my time.
    >
    I want a worker thread to populate a list box.
    >
    I'd like:
    >
    The main thread to be able to abort the process if it wants to.
    The contents of the list box to show the progress.
    >
    Do I need to study any or all the following:
    >
    Polling for Asynchronous Call Completion
    Waiting for an Asynchronous Call with EndInvoke
    Executing a Callback Method When an Asynchronous Call Completes
    Waiting for an Asynchronous Call with WaitHandle
    >
    >
    I found many examples but am not sure which one corresponds to my needs.
    Is there an example of what I described?
    >
    Thanks in advance
    >
    >
    I have been having a lot of success with component classes. Essentially, a
    component class allows all you describe. It also reports progress and allows
    for aborting the process.

    It is outside the scope of this forum to give you a detailed insight into
    component classes. However, this may give you a good place to start.
    Component classes are also excellent for code re-use.

    Cheers


    Comment

    • Tom Shelton

      #3
      Re: Worker thread questions

      On Apr 12, 12:53 pm, " active" <activeNOS... @a-znet.comwrote:
      I'm reading about Threads but there is so much to understand I don't know
      where to spend my time.
      >
      I want a worker thread to populate a list box.
      >
      I'd like:
      >
      The main thread to be able to abort the process if it wants to.
      The contents of the list box to show the progress.
      >
      Do I need to study any or all the following:
      >
      Polling for Asynchronous Call Completion
      Waiting for an Asynchronous Call with EndInvoke
      Executing a Callback Method When an Asynchronous Call Completes
      Waiting for an Asynchronous Call with WaitHandle
      >
      I found many examples but am not sure which one corresponds to my needs.
      Is there an example of what I described?
      >
      Thanks in advance
      I would just look at the BackgroundWorke r component if you are using
      VB2005.

      --
      Tom Shelton

      Comment

      • active

        #4
        Re: Worker thread questions

        I'll try to check this out.
        thanks

        "Harry Strybos" <harry_NOSPAM@f fapaysmart.com. auwrote in message
        news:%23ttfZkUf HHA.596@TK2MSFT NGP05.phx.gbl.. .
        >" active" <activeNOSPAM @a-znet.comwrote in message
        >news:efsmQPTfH HA.2216@TK2MSFT NGP03.phx.gbl.. .
        >I'm reading about Threads but there is so much to understand I don't know
        >where to spend my time.
        >>
        >I want a worker thread to populate a list box.
        >>
        >I'd like:
        >>
        >The main thread to be able to abort the process if it wants to.
        >The contents of the list box to show the progress.
        >>
        >Do I need to study any or all the following:
        >>
        >Polling for Asynchronous Call Completion
        >Waiting for an Asynchronous Call with EndInvoke
        >Executing a Callback Method When an Asynchronous Call Completes
        >Waiting for an Asynchronous Call with WaitHandle
        >>
        >>
        >I found many examples but am not sure which one corresponds to my needs.
        >Is there an example of what I described?
        >>
        >Thanks in advance
        >>
        >>
        I have been having a lot of success with component classes. Essentially, a
        component class allows all you describe. It also reports progress and
        allows for aborting the process.
        >
        It is outside the scope of this forum to give you a detailed insight into
        component classes. However, this may give you a good place to start.
        Component classes are also excellent for code re-use.
        >
        Cheers
        >

        Comment

        • active

          #5
          Re: Worker thread questions

          I am and I will.

          Thanks
          "Tom Shelton" <tom_shelton@co mcast.netwrote in message
          news:1176427130 .112631.240080@ p77g2000hsh.goo glegroups.com.. .
          On Apr 12, 12:53 pm, " active" <activeNOS... @a-znet.comwrote:
          >I'm reading about Threads but there is so much to understand I don't know
          >where to spend my time.
          >>
          >I want a worker thread to populate a list box.
          >>
          >I'd like:
          >>
          >The main thread to be able to abort the process if it wants to.
          >The contents of the list box to show the progress.
          >>
          >Do I need to study any or all the following:
          >>
          >Polling for Asynchronous Call Completion
          >Waiting for an Asynchronous Call with EndInvoke
          >Executing a Callback Method When an Asynchronous Call Completes
          >Waiting for an Asynchronous Call with WaitHandle
          >>
          >I found many examples but am not sure which one corresponds to my needs.
          >Is there an example of what I described?
          >>
          >Thanks in advance
          >
          I would just look at the BackgroundWorke r component if you are using
          VB2005.
          >
          --
          Tom Shelton
          >

          Comment

          Working...