Here is what I have, I have a main form with GUI, that after the user does something, launches a series of test steps in a separate thread, the thread is created in another class, not in the main form.. Assuming I have 2 threads running, at one point the steps they executing has to be synchronized, that is, thread A must wait for thread B until thread B gets to a certain point, then they can both continue.
Technically I employ Backgroundworker class to create the threads.
I tried raising an event to the main form, then when the other threads comes to the point where they have to be synchronized, I would check the data in the main form. However that didn't work at all, because for some reason the for second thread that piece of data is always null, even though it is initialized in the main form. I'm thinking that's because the threading. So I don't know how I can do this. Obviously passing the initialized data to each thread is not going to work because they would have their own copy of it and it would be never synchronized between the separate threads.
Technically I employ Backgroundworker class to create the threads.
I tried raising an event to the main form, then when the other threads comes to the point where they have to be synchronized, I would check the data in the main form. However that didn't work at all, because for some reason the for second thread that piece of data is always null, even though it is initialized in the main form. I'm thinking that's because the threading. So I don't know how I can do this. Obviously passing the initialized data to each thread is not going to work because they would have their own copy of it and it would be never synchronized between the separate threads.