Communication between variables in Multiple Threads
Hello,
I am kinda new to this and I've never really worked with multi threads, decided to finally learn but I can't figure out how I can read the variables of one thread in the other.
4 Replies
declare the variable outside of the functions, in the enclosing class.
You may have to worry about locking for thread safety, I honestly don't know much about that on single variables
Could you please provide me with an example
I'm on mobile now so my example is not great, but above void Kekw1, you could place
string[] results1;
Then in Kekw1, you would just say results1 = UseImageSearch(...)
instead of declaring it each time
unless I'm misunderstanding :) It's a little hard to see what's going on here with this limited portion - I'm also not sure what you exactly want from these 2Testing right now to see if I understood seem to work my G, though im prob doing smth wrong