Hi, 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? Thanks
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.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
"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: