Welcome to WebmasterWorld Guest from 34.229.194.198

Forum Moderators: ocean10000

Message Too Old, No Replies

Start multiple threads in VB.Net

     
1:10 pm on Oct 5, 2008 (gmt 0)

New User

10+ Year Member

joined:Mar 19, 2008
posts:23
votes: 0


Hi!

Can someone show me how to start multiple threads in vb.net ?

Thanks!

3:21 pm on Oct 10, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 24, 2005
posts:965
votes: 0



Dim myThread As Thread = New Thread(New ThreadStart(mythreadmethod))
myThread.Start()

Private Sub mythreadmethod()
' Code you put here will be run in a new thread.
End Sub

7:17 am on Oct 11, 2008 (gmt 0)

New User

10+ Year Member

joined:Mar 19, 2008
posts:23
votes: 0


Thanks!

If i run 5 threads then i must write this code 5 times or just put the code once ?

2:01 pm on Oct 13, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 24, 2005
posts:965
votes: 0



Dim myThread1 As Thread = New Thread(New ThreadStart(mythreadmethod1))
myThread1.Start()

Dim myThread2 As Thread = New Thread(New ThreadStart(mythreadmethod2))
myThread2.Start()

Private Sub mythreadmethod1()
' Code you put here will be run in a new thread.
End Sub

Private Sub mythreadmethod2()
' Code you put here will be run in a new thread.
End Sub

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members