Threading Question - Newbie

  • Thread starter Thread starter Benjamin Pierce
  • Start date Start date
B

Benjamin Pierce

Hi All,

I'm fairly new to the world of threading in VB.NET and would like to know if
it's possible (and not unstable) to access a global object (in a form class)
with multiple threads that are spawned from within the same form.

I know that you're not allowed to access GUI elements from threads other
than the UI thread, so I guess I'm just wondering if the same applies to
global variables.

Any help would be much appreciated.

Thank You,

Benjamin Pierce
 
Benjamin,

You can use in both threads the global variables.

However you have to synclock them when you are changing those variables in
more threads.

I hope this helps,

Cor
 

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

Back
Top