Re: [android-developers] Re: AsyncTask + NDK = Neverending process
Streets Of Boston wrote:
> Why is this a code-smell? Interrupting long-running threads that 'wait
> ()' is perfectly fine for controlling these threads, telling them to
> do stuff, pause or even stop and exit.
All of the following is IMHO.
In most cases, if you have to use wait()/cancel(), you're working at too
low of a level. There are reasons why countless engineers (e.g., Doug
Lea) have spent innumerable hours putting together java.util.concurrent
and kin -- getting threading right is *hard*. I would rather see
engineers use higher-order, highly-tested frameworks unless they are
actually trying to write such a higher-order framework.
I'm also not a fan of cancel()-ing threads you didn't create, though
that's what AsyncTask tries to allow, so apparently the core Android
team disagrees with me on that point.
Again, this is just my opinion.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Android App Developer Books: http://commonsware.com/books
--
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