multithreading - Multi threading for one process vb.net -


i learned basics of multi threading in vb.net need multi threading 1 process code :

private sub btnloadnow_click(byval sender system.object, byval e system.eventargs)      dim t1 new thread(addressof myprocess)      t1.start()        dim t2 new thread(addressof myprocess)      t2.start()        dim t3 new thread(addressof myprocess)      t3.start()        dim t4 new thread(addressof myprocess)      t4.start()        dim t5 new thread(addressof myprocess)      t5.start()    end sub    private sub myprocess()     'my process codes    end sub

but code have error how can make it?

you dont have defined autoload.

dim t1 new thread(addressof autoload) 

just replace autoload ---> myprocess

dim t1 new thread(addressof myprocess) 

and

private sub myprocess()    'my process codes next 

sub have end end sub

private sub myprocess()        'my process codes end sub 

this code working

imports system.threading module module1      sub main()         dim t1, t2, t3, t4 thread          t1 = new thread(addressof myprocess)         t2 = new thread(addressof myprocess)         t3 = new thread(addressof myprocess)         t4 = new thread(addressof myprocess)          t1.start()         t2.start()         t3.start()         t4.start()      end sub      private sub myprocess()       'some code     end sub  end module 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -