0

in my application i have 20 icons(bitmap fields) on the home screen When i click on any icon an HTTP request is made in a separate thread.

I have used invoke later method wherever necessary to take care of multi-threading problems.

But still the number of threads goes beyond 16 and an error pops up indicating too many threads error and applications needs to be restarted!!

can anybody tell me how to destroy these threads when they are no longer in use. I don't understand why they don't destroy on their own as usually they do.

Swati
  • 2,870
  • 7
  • 45
  • 87
  • possible duplicate http://stackoverflow.com/questions/1410990/too-many-threads-exception – Vivart Jun 08 '10 at 09:19
  • no i am not sending all the request at once My problem is that the earlier created threads don't destroy. If work of a thread is finished then it should not be an active thread. I cant queue up the requests as i don't know user will click on which icon and the results will take time to display tooo. can u tell me what should i do – Swati Jun 08 '10 at 09:56
  • Please include the code you're using for the HTTP request, redacted if you need to. Threads will normally terminate on their own when completed (unless the request is timing out); so we'd need to see what your thread might be doing that could prevent this. Also, I'm assuming this only happens after you make 16 clicks? – Marc Paradise Jun 09 '10 at 17:51

1 Answers1

0
I tried to go ahead with active count of thread
If that count exceeds beyond the limit set by me then i queue up the request 

and then send them later on after sometime.

but this delays the response.

I had no other option other than this

Thanks for help!!!!!!!
Swati
  • 2,870
  • 7
  • 45
  • 87