Queue Threading sProgressBar

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #51591
    Stertor
    Participant

      maybe this will help.

      #51592
      mboloz
      Participant

        🙁 Thanks dude, but not yet like what i wanted..

        try to click the button twice or more, the thread is overlaping by new execute,

        what i want is, thread execute twice but waiting one by one done

        #51595
        mboloz
        Participant

          its not about detect the thread already running or not, i precisely need the thread execute many time

          but the progress waiting each, not by overlaping by new execute

          sorry for bad english…

          #51597
          CheshireCat
          Participant

            Hello,

            you can use my class for save threads in a waiting list. Look at the attached demo 🙂

            [attachment=6666:Queue Thread.zip]

            Note:

            I use TGauge instead TProgressBar, a TProgressBar is not suitable in threads!

            #51596
            mboloz
            Participant
              'CheshireCat' wrote:

              Hello,

              you can use my class for save threads in a waiting list. Look at the attached demo 🙂

              [attachment=6666:Queue Thread.zip]

              Note:

              I use TGauge instead TProgressBar, a TProgressBar is not suitable in threads!

              :a3: hey thanks, but the fmain.pas i cant found it, would you upload it again?

              #51598
              CheshireCat
              Participant

                Sorry for missing file, here is the complete demo with all files:

                [attachment=6667:Queue Thread.zip]

                #51599
                mboloz
                Participant
                  'CheshireCat' wrote:

                  Sorry for missing file, here is the complete demo with all files:

                  [attachment=6667:Queue Thread.zip]

                  :a3: many thanks, works perfectly… case closed

                  #51600
                  Stertor
                  Participant

                    ЧеширскийКот, он только-только стал изучать потоки, могу представить, как он разбирается в вашем примере )

                    Чем не устраивают критические секции? Просто вынести процедуру заполнения прогрессбара в основной поток (с помощью Synchronize) и все.

                    К тому же, в этом случае отпадают танцы с бубном около Tgauge, см. пример:

                    #51593
                    CheshireCat
                    Participant

                      Hello Stertor,

                      your code example is correct but it doesn't solve the problem. If you click on the button during ProgressBar is filling you don't create a new thread, it starts the Execute method from the begin only (same Thread-ID). Each click on the button should create a new thread that also runs to the end before the next is executed (various Thread-ID)!

                    Viewing 9 posts - 1 through 9 (of 9 total)
                    • You must be logged in to reply to this topic.