Wow. Just checked my 4.0.1 and 4.0.3 sources - yes, it's there:
/**
* An {@link Executor} that can be used to execute tasks in parallel.
*/
public static final Executor THREAD_POOL_EXECUTOR
= new ThreadPoolExecutor(CORE_POOL_SIZE,
MAXIMUM_POOL_SIZE, KEEP_ALIVE,
TimeUnit.SECONDS, sPoolWorkQueue, sThreadFactory);
/**
* An {@link Executor} that executes tasks one at a time in serial
* order. This serialization is global to a particular process.
*/
public static final Executor SERIAL_EXECUTOR = new SerialExecutor();
private static volatile Executor sDefaultExecutor = SERIAL_EXECUTOR;
The documentation is still somewhat lacking: "After HONEYCOMB, it is
planned to change this back to a single thread to avoid common
application errors caused by parallel execution."
"Planned to change" is not the same as "Yes, we did it".
Anyway, back to the original issue - Zsolt didn't mention which
executor his code is using and which Android version his customer is
running.
Also of interest: AsyncTaskLoader explicitly uses THREAD_POOL_EXECUTOR.
-- K
22 марта 2012 г. 1:29 пользователь Mark Murphy
<[email protected]> написал:
> 2012/3/21 Kostya Vasilyev <[email protected]>:
>> From what you've described, it seems possible - since AsyncTask uses a
>> pool of more than one thread, and you also mentioned running this
>> query on the UI thread as well.
>
> Actually... on ICS, that's apparently no longer true.
>
> Somebody tweeted this year-old commit today:
>
> https://github.com/android/platform_frameworks_base/commit/81de61bfddceba0eb77b3aacea317594b0f1de49
>
> which looks like they're only doing one at a time by default in ICS,
> unless you use an Executor with a thread pool.
>
> I need to run some tests to confirm that this indeed is the ICS
> implementation.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android Training...At Your Office: http://commonsware.com/training
>
> --
> 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
--
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