Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


[java] do threads increase efficiency in mobile games?

This topic is 5229 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi i want to develop a game for mobiles using MIDP (remember this is my first try), should i use threads or go without it, how does the threads effect the efficiency, will the use of thread will have positive effect? if yes then how? bye

Share this post

Link to post
Share on other sites
Unless you actually do have multiple CPUs, multiple threads cannot possibly speed up your app (in fact context switching between threads will slow you down slightly).

Multi-threading *may* increase how responsive your app looks to the user, but thats going to depend on what you''re doing.

Share this post

Link to post
Share on other sites
Threads are not used to increase efficiency, but so you can do something else while one thread''s blocked. It would not be productive to have more than one thread trying to run at once.

No phone has SMP (some have multiple processors, but only one will be running Java code, the others for special tasks)

It''s normal to have one thread (timer) besides any threads which are created for you.

What I do, is do all the processing inside the timer thread, then call repaint().

Your drawing may get done in another thread. Events (like button pushes) might get done in yet another thread, or perhaps the same one as the drawing.

In any case, you will need to create a timer thread.

A useful way of doing this is using java.util.Timer


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!