Archived

This topic is now archived and is closed to further replies.

jplocster

MultiThreading in Visual Basic.NET

Recommended Posts

jplocster    122
I am mainly a c++ programmer but my new job is mandating that I use Visual Basic.NET for their latest project. Currently, everything seems very easy to use and quick for GUI development compared to the raw win32 c++ code I am used to. I am trying to figure out how to multithread in VB.Net (I have only been using VB.net for 2 days) as I need to have the user interface be responsive while processing large binary files. Any help from someone who has already tackled this problem or knows how to handle this in VB would be appreciated. I am currently reading one of the walkthroughs on multithreading for VB that come with .NET but always perfer advice from those with experience. Thanks in advance.

Share this post


Link to post
Share on other sites
thona    100
ThreadPool class :-) Issue a work ticket. That simple. There are examples for this (as well as starting your own thread) in every beginner section I have seen so far.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites
daerid    354
Also, the Thread and ThreadStart classes make multi-threading in .NET a breeze.

Just create a ThreadStart instance using a method that returns void and takes no arguments.

something like this:

Dim oThreadStart as ThreadStart
Dim oThread as Thread
Set oThreadStart = New ThreadStart(Class.MyFunction)
Set oThread = New Thread(oThreadStart)
oThread.Start


Not entirely sure if that''s the appropriate syntax, but that''s roughly the equivalent of how it''s done in C#

Share this post


Link to post
Share on other sites