Question: I am using Python 2.7.

I have been experimenting with the interpreter and found out the following unusual thing. I wrote the following code and it's working:

```
    def func():
        a = 5 ;
        print a

```

When I call this function, it gives the required output in the interpreter, not giving any syntax error, despite using the semicolon. Here is the screenshot:

![Enter image description here](https://i.stack.imgur.com/f6emO.png)

Why is it not giving a *syntax error*?

Answer: 
If your implementation for `AsyncTask` is correct, then the possible reason for this behaviour is because the default `executor` for `AsyncTasks` is `SERIAL_EXECUTOR`. 

To run multiple `AsyncTask` instances in parallel (not serially.. no one after other). execute them as follows:

```
if (Build.VERSION.SDK_INT >= 11) {
    outstandingTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
    outstandingTask.execute();
}

```

From the [documentation](http://developer.android.com/reference/android/os/AsyncTask.html#):

> 
> When first introduced, `AsyncTask` were executed serially on a single
>  background thread. Starting with `DONUT`, this was changed to a pool of
>  threads allowing multiple tasks to operate in parallel. Starting with
>  `HONEYCOMB`, tasks are executed on a single thread to avoid common
>  application errors caused by parallel execution.
> 
> 
> If you truly want parallel execution, you can invoke
>  `executeOnExecutor(java.util.concurrent. Executor, Object[])` with
>  `THREAD_POOL_EXECUTOR`.
> 
> 
>
There are multiple Options to run `asyncrhonously` Either you can use two `AsyncTask` which contains a method called `doInBackground()` for your use. Or simple you can use two `threads`.

Eg: `Thread`

```
Thread thread = new Thread()
{
@Override
public void run() {
    try {
        while(true) {
           // your code
        }
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
};

thread.start();

```

If you want any `delay` Use `Handler`.

Or 

You need to do any `UI` Operations you should use `RunOnUIThread()`