Simple multithreading

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

    #1

    Simple multithreading

    I have some code that iterates through a directry doing stuff and I would
    like to get the results text box I have on the windows form, to update
    accordingly. I have a progress bar that was working fine but when I put the
    textbox on the form the whole form blanks until the processing is complete.

    How would I go about using threads to keep the form components updating
    themselves?

    Thanks for any help,
    Grant


  • Jorge Matos

    #2
    RE: Simple multithreading

    Here's a primer on multi-threading by Chris Sells
    http://msdn.microsoft.com/library/de...ms06112002.asp

    Juval Lowy has a good component for running background tasks called
    BackGroundWorke r:


    HTH,
    Jorge

    "Grant" wrote:
    [color=blue]
    > I have some code that iterates through a directry doing stuff and I would
    > like to get the results text box I have on the windows form, to update
    > accordingly. I have a progress bar that was working fine but when I put the
    > textbox on the form the whole form blanks until the processing is complete.
    >
    > How would I go about using threads to keep the form components updating
    > themselves?
    >
    > Thanks for any help,
    > Grant
    >
    >
    >[/color]

    Comment

    • Doker

      #3
      Re: Simple multithreading

      You are thinking about using
      a = new System.Threadin g.Thread( addressof somesub )
      a.start

      ?


      Comment

      • Grant

        #4
        Re: Simple multithreading

        Thanks Jorge,
        Some useful info on that msdn link...

        "Jorge Matos" <JorgeMatos@dis cussions.micros oft.com> wrote in message
        news:E202569F-9F88-48D0-8297-B5F23C9873EB@mi crosoft.com...[color=blue]
        > Here's a primer on multi-threading by Chris Sells:
        > http://msdn.microsoft.com/library/de...ms06112002.asp
        >
        > Juval Lowy has a good component for running background tasks called
        > BackGroundWorke r:
        > http://www.idesign.net/idesign/Deskt...ndex=5&tabid=8
        >
        > HTH,
        > Jorge
        >
        > "Grant" wrote:
        >[color=green]
        >> I have some code that iterates through a directry doing stuff and I would
        >> like to get the results text box I have on the windows form, to update
        >> accordingly. I have a progress bar that was working fine but when I put
        >> the
        >> textbox on the form the whole form blanks until the processing is
        >> complete.
        >>
        >> How would I go about using threads to keep the form components updating
        >> themselves?
        >>
        >> Thanks for any help,
        >> Grant
        >>
        >>
        >>[/color][/color]


        Comment

        • Grant

          #5
          Re: Simple multithreading

          Yeah something real simple like that. I need to be able to have two threads,
          thread A updates the windows form components, textbox and progress bar, and
          Thread B does all the work (Occasionally telling Thread A where its at).

          "Doker" <doker0@wp.pl > wrote in message
          news:d1jvbp$uu5 $1@node2.news.a tman.pl...[color=blue]
          > You are thinking about using
          > a = new System.Threadin g.Thread( addressof somesub )
          > a.start
          >
          > ?
          >[/color]


          Comment

          Working...