1

Let us have some background information , if you are using some library is releate to network connection , database operation etc , you will need to run it on another thread instead of main thread .

Reference to Picasso :

 public Builder executor(ExecutorService executorService)

we can see they have expose the executorService for us .

as here for android developer doc say that it is better to run the tasks on thread pool.

so , is it the best solution of us to avoid create so many threads?? i think it is great . i think is time to stop use all of the new Thread(new Runnable(){}).start();

rex
  • 821
  • 3
  • 10
  • 21

1 Answers1

0

Use an Executor. Android concurrency usage

(edit)

Best advice I can offer is, it depends on the granularity with which you need to control the tasks being executed. Think about whether certain components may generate more tasks than others--which ones might be greedy. Greedy components might warrant their own thread[pool]. For ui tasks, you already have the AsyncTask threadpool.

Community
  • 1
  • 1
dcow
  • 7,765
  • 3
  • 45
  • 65
  • nice post , but i just want to discuss with expose a executor to share thread-pool corss different component, thanks – rex May 28 '14 at 07:26
  • More a [programmers](http://programmers.stackexchange.com) question, because it's really designers choice on that one. – dcow May 28 '14 at 07:30
  • can you share more details?? – rex May 28 '14 at 08:39