Ideally, your progressbar should be in the main thread. The maze
generation can be done using Asyctask . Asynctask is an excellent way
to do tasks on a different thread provided by the android framework,
and has built in methods to post changes to the main thread.
You can know about AsyncTask here, here and here .
For a heads up, once you create a class extending Asynctask, you can
do the ma

Make sure you're updating the UI control from the correct thread.
FileSystemWatcher will be raising an event on a thread that is not the
UI thread.
Typically this means you need to create an interface on your UI
hosting class that checks whether you can access the DataGridView
before updating the Control.
The code required to do the checking and invoking can be found here:
How to update the GUI

You haven't shown the code that starts the threads, but it sounds like
maybe you're assuming Runnables are Threads. They're not.
A Runnable is just that: a thing you can run by calling its run()
method. But it runs in the same thread you call it from.
An example to see what I'm talking about:
public static void main(String[] args) {
final Thread mainThread = Thread.currentThread();
Runn

When you call Status() right after you call getProduct(), there's a
good chance that the new thread hasn't started doing anything yet.
You are still in the original thread, and the new thread has to set up
and start running.
Your join in the destructor is not really meaningful for this
exercise. If you wanted to make sure to collect the result and do
something with it as Machine goes out of sco

Ok I'm answering this for future use if anyone encounters the same
problem. Apparently javacript properties outerWIdth and outerHeight
are always set to 0 in Mobile Safari so if you have a code like this:
if(this.outerWidth == 0 || this.outerHeight == 0) {
redirect();
}
redirect() will never happen in Mobile Safari (ios v8.1.1)