• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multi Threading Concept.!!

 
Imran Mohd
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

i am in to Game development, so i am using many thread in my game
i was facing many issues ,one of them is

When DVM run's out-Of-Memory than DVM is killing my running threads...!!

Does your book Cover Handling Multiple Threads in the application...?
So that i can implement Multi-Threading Concept Efficiently..
 
Fred Grott
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you done any profiling via using the Eclipse debug view yet as far as how many threads and how much space each thread takes?

 
Ed Burnette
Author
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a little on threading in the communications chapter (doing network I/O on a different thread). I recommend Brian Goetz's book, Java Concurrency in Practice, for a deep dive on threading. I have a signed copy, and you can't have it.

IMHO threads are over-used. I'm guilty of doing this too. As a rule of thumb there should be one, maybe two threads per CPU core. If you have more than that you're just inviting problems with contention, switching overhead, and memory.

I'm not aware of any feature in Android that will kill certain threads but leave others running. Check your exception handling carefully and use the Log.d() and Log.e() functions to see what's going on, and simplify the program to eliminate unnecessary threads.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic