VB Threading issues

  • Thread starter Federico G. Babelis
  • Start date
F

Federico G. Babelis

Hi All:

Im new to the threading programming, and i have problem working with threads
in my VB.NET application. I have a module.vb with the following thread
definition in the declarations:

Public Thread_Test As New System.Threading.Thread(AddressOf
MDIChild.SomeFunction)

The problem resides after the thread had been terminated, how can i start a
new thread for the same function ?, also the fuction should be able to call
Thread_Test.start(); Thread_Test.Suspend() and Thread_Test.resume() from any
function in the program.

Any idea ?

Thanks,
Federico
 
M

MeltingPoint

Hi All:

Im new to the threading programming, and i have problem working with
threads in my VB.NET application. I have a module.vb with the
following thread definition in the declarations:

Public Thread_Test As New System.Threading.Thread(AddressOf
MDIChild.SomeFunction)

The problem resides after the thread had been terminated, how can i
start a new thread for the same function ?, also the fuction should be
able to call Thread_Test.start(); Thread_Test.Suspend() and
Thread_Test.resume() from any function in the program.

Any idea ?

Thanks,
Federico

I may be wrong here, but if Thread_Test is defined at the *module* level
then you should just be able to call Thread_Test.Start anytime any where
inside that module. If it's out side the module *I THINK* Thread_Test
needs to be declared as "Public Shared Thread_Test As New
System.Threading.Thread(AddressOf MDIChild.SomeFunction)" and referenced
as Module1.Thread_Test.Start()

Also I believe the SomeFunction should be SomeSub (can't use functions)
as well, and that Sub will also have to be declared as "Shared" then you
should be good to go.

MP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top