上传MultipuleThread机器人批量图片 [英] Upload Bulk Image in MultipuleThread android

查看:326
本文介绍了上传MultipuleThread机器人批量图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我使用的AsyncTask上传图像中单个线程。但它是有效的,它是需要大量的时间来载。所以我指这链接使用ThreadPoolExecuter下载图像。同时上传图像也能够使用这个策略?

这是很好的做法,上传图片?


解决方案

  

是上传图片的好的做法呢?


是的,这可能是一个选项,如果你不担心每个执行的跟踪(即当线程完成了它的任务)。

看看谷歌文档说:


  

他们通常在执行较大的数字时提供更高的性能
  异步任务,由于每个任务调用的开销减少,
  和他们提供包围和管理资源的一种手段,
  包括线程,消耗执行任务的集合时。


right now i am uploading image in single thread using asynctask. but it is not efficient and it's takes lot of time to upload. so i am refering this link to download image using ThreadPoolExecuter. can i use this strategy while uploading image also ?

is this good practice to upload image?

解决方案

is this good practice to upload image?

YES that could be an option if you don't worry about tracking of each execution (i.e when thread completed its task ).

See what google doc says

they usually provide improved performance when executing large numbers of asynchronous tasks, due to reduced per-task invocation overhead, and they provide a means of bounding and managing the resources, including threads, consumed when executing a collection of tasks.

这篇关于上传MultipuleThread机器人批量图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆