• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

real time networking

Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if i've put this in the correct forum - apologies if this is the incorrect one.
I'm doing a two player networked game in java, and i was going over the theory of the networking - with this game it has to be real time because the players are fighting.
Is it possible to *really* network in real time with java? If my understanding of java is right, then the "real-timeness" can be affected by garbage collection and the scheduling by the OS?
Does anyone have any good links or information on real time networking in java?
Posts: 9099
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everything is affected by the scheduling by the OS. That is one of the functions of the OS, to schedule processes and threads. As far as I know, networking in Java will not be affected more than networking in any other language.

Are you creating and discarding lots of Objects during your game (while you are actually playing it)? Again, this would not affect the networking part of the game, but it might slow down the player's response if he has to wait until his JVM collects some garbage that he has discarded.
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Real-time" performance is not an attribute aof any high-level programming language. Rather, it is a feature on the operating system that specifies a bounded (and minimal) latency in response to an interrupt. "Real-time Java" is no more meaningful than "real-time C" or "real-time LISP."
However, the network itself -- packet losses, router hiccups, etc., are very likely sources of performance impediments. The best the programmer can do is take those delays and errors into account; you can't program around them, not in any language.
Garbage collection is the least of your optimization worries.
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic