• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Multi Threading Concept.!!

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
Author
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic