Can Doinbackground In An Asynctask Potentially Cause A Race Condition?
Does the return of a result from the doInBackground method on AsyncTask to the UI have the potential to cause unexpected race conditions? Using 'get' can make the UI wait for the c
Solution 1:
doInBackground runs on another thread, so of course it can cause a race condition- anytime you have two threads, or a thread and asynchronous events incoming you can have a race condition. You always have to code to avoid them. However the return of values from doInBackground to onPostExecute will not, so you do have a safe way of passing data between the threads without a race.
Post a Comment for "Can Doinbackground In An Asynctask Potentially Cause A Race Condition?"