Question on coding multi threaded
Started by SteamyBeauty

Posts:103
Threads:26
Reputation:
Gold: 84
Official Knight of Sentry.MBA
Knight
Posts:103
Threads:26
Joined:Nov 2017
Reputation: 19
Warning Level:
Likes:18 in 18 posts
Gold: 84
HeartPizzaCool KidSunshineAsswipeGamblerAlienHunnidActive
01-04-2018, 04:25 AM (This post was last modified: 01-04-2018, 04:25 AM by SteamyBeauty.)
So I am having some issues on multi-threading. I got it working somewhat, but I want to speed up the process...

Currently I have a search code
Code:
   Private Sub Searchz()
       Dim z As Integer
       z = RichTextBox1.Lines.Count - 1
       For i As Integer = 0 To RichTextBox1.Lines.Count - 1
           If RichTextBox1.Lines(i).Contains("puzzay") Then
               ListBox1.Items.Add(RichTextBox1.Lines(i).ToString)
           End If

           Me.ProgressBar1.Value = ((i / z) * 100)
       Next
   End Sub


So I run the thread of this button I made
Code:
   Private Sub MephButton5_Click(sender As Object, e As EventArgs) Handles MephButton5.Click
       thread = New System.Threading.Thread(AddressOf Searchz)
       thread.Start()

   End Sub


So the whole function of this code is to search through a wordlist and find the word "puzzay" in the list and put it inside a listbox. It works fine, but the issue is I want to have multiple threads working together on checking the whole wordlist faster. Any suggestions?

[Image: 2lup7ao.jpg]]

Posts:1
Threads:0
Reputation:
Gold: 0
Official Member of Sentry.MBA
Member
Posts:1
Threads:0
Joined:Feb 2018
Reputation: 0
Warning Level:
Likes:1 in 1 posts
Gold: 0
02-11-2018, 12:26 AM
There is no need to search in RichTextBox line by line!
RichTextBox has method Find already => RichTextBox.Find






Users browsing this thread: 1 Guest(s)