• 0

[VB.NET] Threading


Question

Hello gang,

I'm making an app that can display multiple media (on multiple monitors) and thought that it MIGHT be a good idea to thread each "player". However I need to access functions for each player once the thread is started. I'm looking around and cannot find out how to do this. Any sugestions?

Thanks,

James

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I have threading used in one of my programs. I use C# for my personal stuff. .NET has a very nice threading package.

What I did was have a thread manager class, the actual threading class, and an object class with member functions and variables.

Thread manager was responsible for passing objects to threads to fire off and keeping track of them all. It could also return all the objects that were sent to the threads.

Thread class would fire off the actual threading and whatever do work function on the object. Also responsible for updating the objects.

Hope this helps.

Link to comment
Share on other sites

  • 0

Calling a method between two threads is pretty straight-forward. However, when you need to pass arguments or retrieve a return value between two threads, things can get a bit complicated.

Have a look at Asynchronous Method Invocation on CodeProject, which should explain everything you need. It's in C# though, but the methods described should be perfectly usable in VB.NET.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.