"*Curiouser and curiouser*!" *Cried Alice*

Running your code on my GNex with official 4.0.2 I get this:

04-21 00:41:08.327 I/ParallelTasks(14355): A started
04-21 00:41:18.335 I/ParallelTasks(14355): A ended
04-21 00:41:18.335 I/ParallelTasks(14355): B started
04-21 00:41:28.335 I/ParallelTasks(14355): B ended
04-21 00:41:28.335 I/ParallelTasks(14355): C started
04-21 00:41:38.343 I/ParallelTasks(14355): C ended
04-21 00:41:38.343 I/ParallelTasks(14355): D started
04-21 00:41:48.335 I/ParallelTasks(14355): D ended
04-21 00:41:48.343 I/ParallelTasks(14355): E started
04-21 00:41:58.343 I/ParallelTasks(14355): E ended

Note the timestamps.

Here is my test, same idea really:

http://codetidy.com/2565/

and it also shows that the default execute() on my GNex with 4.0.2 is
serialized:

04-21 00:51:22.788 I/TestAsyncTask(14899): testDefaultExecutor
04-21 00:51:22.788 I/TestAsyncTask(14899): onPreExecute 0
04-21 00:51:22.788 I/TestAsyncTask(14899): onPreExecute 1
04-21 00:51:22.788 I/TestAsyncTask(14899): onPreExecute 2
04-21 00:51:22.788 I/TestAsyncTask(14899): onPreExecute 3
04-21 00:51:22.788 I/TestAsyncTask(14899): onPreExecute 4
04-21 00:51:22.788 I/TestAsyncTask(14899): doInBackground 0
04-21 00:51:27.796 I/TestAsyncTask(14899): doInBackground 1
04-21 00:51:32.796 I/TestAsyncTask(14899): doInBackground 2
04-21 00:51:37.796 I/TestAsyncTask(14899): doInBackground 3
04-21 00:51:42.804 I/TestAsyncTask(14899): doInBackground 4
04-21 00:51:47.804 I/TestAsyncTask(14899): done

04-21 00:51:47.804 I/TestAsyncTask(14899): testThreadPoolExecutor
04-21 00:51:47.804 I/TestAsyncTask(14899): onPreExecute 0
04-21 00:51:47.804 I/TestAsyncTask(14899): onPreExecute 1
04-21 00:51:47.804 I/TestAsyncTask(14899): onPreExecute 2
04-21 00:51:47.804 I/TestAsyncTask(14899): onPreExecute 3
04-21 00:51:47.804 I/TestAsyncTask(14899): onPreExecute 4
04-21 00:51:47.804 I/TestAsyncTask(14899): doInBackground 0
04-21 00:51:47.804 I/TestAsyncTask(14899): doInBackground 2
04-21 00:51:47.804 I/TestAsyncTask(14899): doInBackground 1
04-21 00:51:47.804 I/TestAsyncTask(14899): doInBackground 3
04-21 00:51:47.811 I/TestAsyncTask(14899): doInBackground 4
04-21 00:51:52.811 I/TestAsyncTask(14899): done

Again, note the timestamps (although the order is obvious).

On an Asus Tranformer with 4.0.3, I am getting the same results, the
default execute is serial.

Sanity check on a Sony Tablet S with 3.2.1, the default execute uses a
thread pool:

04-21 01:10:22.870 I/TestAsyncTask( 1002): testDefaultExecutor
04-21 01:10:22.880 I/TestAsyncTask( 1002): onPreExecute 0
04-21 01:10:22.880 I/TestAsyncTask( 1002): onPreExecute 1
04-21 01:10:22.880 I/TestAsyncTask( 1002): doInBackground 0
04-21 01:10:22.880 I/TestAsyncTask( 1002): onPreExecute 2
04-21 01:10:22.880 I/TestAsyncTask( 1002): onPreExecute 3
04-21 01:10:22.890 I/TestAsyncTask( 1002): onPreExecute 4
04-21 01:10:22.890 I/TestAsyncTask( 1002): doInBackground 4
04-21 01:10:22.890 I/TestAsyncTask( 1002): doInBackground 3
04-21 01:10:22.890 I/TestAsyncTask( 1002): doInBackground 2
04-21 01:10:22.890 I/TestAsyncTask( 1002): doInBackground 1
04-21 01:10:27.890 I/TestAsyncTask( 1002): done

04-21 01:10:27.890 I/TestAsyncTask( 1002): testThreadPoolExecutor
04-21 01:10:27.890 I/TestAsyncTask( 1002): onPreExecute 0
04-21 01:10:27.890 I/TestAsyncTask( 1002): onPreExecute 1
04-21 01:10:27.890 I/TestAsyncTask( 1002): onPreExecute 2
04-21 01:10:27.900 I/TestAsyncTask( 1002): onPreExecute 3
04-21 01:10:27.900 I/TestAsyncTask( 1002): onPreExecute 4
04-21 01:10:27.900 I/TestAsyncTask( 1002): doInBackground 0
04-21 01:10:27.900 I/TestAsyncTask( 1002): doInBackground 1
04-21 01:10:27.900 I/TestAsyncTask( 1002): doInBackground 3
04-21 01:10:27.900 I/TestAsyncTask( 1002): doInBackground 4
04-21 01:10:27.900 I/TestAsyncTask( 1002): doInBackground 2
04-21 01:10:32.900 I/TestAsyncTask( 1002): done

04-21 01:10:32.900 I/ParallelTasks( 1002): A started
04-21 01:10:32.900 I/ParallelTasks( 1002): B started
04-21 01:10:32.910 I/ParallelTasks( 1002): D started
04-21 01:10:32.910 I/ParallelTasks( 1002): E started
04-21 01:10:32.910 I/ParallelTasks( 1002): C started
04-21 01:10:42.910 I/ParallelTasks( 1002): B ended
04-21 01:10:42.910 I/ParallelTasks( 1002): C ended
04-21 01:10:42.910 I/ParallelTasks( 1002): A ended
04-21 01:10:42.910 I/ParallelTasks( 1002): E ended
04-21 01:10:42.910 I/ParallelTasks( 1002): D ended


-- K

21 апреля 2012 г. 0:21 пользователь Mark Murphy
<[email protected]>написал:

> 2012/4/20 Kostya Vasilyev <[email protected]>:
> > The default is definitely serial on my GNex with 4.0.2.
> >
> > Did they revert it again for the 4.0.3 that you have?
>
> Here's how I am testing it (sloppy code, but it meets the need):
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to