Sunday, September 4, 2011

[android-developers] Re: Multithread, concurrent thread

Yeah, it is easy enough to check to see whether you can run 100
threads. I imagine the question is whether it is advisable to do so,
or not. ... and since you are asking this, I'll bet you already have
a fairly good guess about the answer...

I am not completely certain about how Dalvik does memory management,
but on the Sun JVM, not only does each thread take a noticeable amount
of space, itself, it can also affect the way the heap is organized,
and the garbage collector runs. The overhead due to 100 threads is
going to be significant.

It seems surprising that you would have 100 things actually happening
simultaneously. From a resource management perspective, it would be
better if you could abstract the tasks that you need run as smallish
objects that store just the task state. Then use a pool of threads
(maybe and ExecutorService?) to "animate" the ones that can actually
move forward.

It's true! You are being asked to replicate the system that allocates
CPUs to threads! Unfortunately, it is probably worth the work.

-blake
Programming Android, FTW!
http://oreilly.com/catalog/0636920010364


On Sep 3, 3:03 pm, Christopher Van Kirk
<christopher.vank...@gmail.com> wrote:
> No idea if it's possible, but is it wise? Considering there are a
> maximum of two cpus to work with, what are you gaining with so many threads?
>
> On 9/4/2011 5:52 AM, Goutom wrote:
>
>
>
>
>
>
>
> > Hello
>
> > I want to run 100 thread concurrently.Is it possible for android?
>
> > Regards
> > RiskyCoder
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscribe@googlegroups.com
> > 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate