Jump to content

  • Log In with Google      Sign In   
  • Create Account


medv4380

Member Since 12 Jan 2012
Offline Last Active Jan 27 2012 04:05 PM
-----

Posts I've Made

In Topic: Task Parallism - Gpu affinity

27 January 2012 - 10:19 AM

A Phaser or Cyclic Barrier may help in what you are trying to do.

What I've done myself is create 1 Display thread for the OpenGL Context and N-1 Logic Threads. On my quad core that leaves me with 4 active threads running in parallel. The logic threads add their tasks for the next display frame and then swap their queue with another queue at the end of the cycle/phase. Basically the Display thread is always showing the frame the logic threads previously worked on. However, to do it right you have to double up on any memory variables that are shared since you don't want the Logic Threads changing the previous frames Display Variables.

You're going to come to a point where you'll have to decide if you want efficiency of processor use, or waist memory to increase processor utilization.

In Topic: DOD and memory layout

25 January 2012 - 11:08 AM

Yuukan, I think you have it close.
Your method matches a valid example http://stackoverflow.com/questions/1641580/what-is-data-oriented-design

How you structure the data will depend on what you're doing, and turch does have a point since X and Y are apart of the Position it would be good to keep them together.

You may also want to consider an additional layer of abstraction because if you approach it with what you have you'd end up with a struct for orcs, elves and anything else that would be nearly identical.

In Topic: C++ V.S Java for game programming.

24 January 2012 - 11:08 PM

This should satisfy your benchmark source request, and it should give you an ample number of languages to do additional comparisons.
http://shootout.alio...rg/u32/java.php

First Java7 has vastly improved from Java6 but that's 5 years of updated given in 1 version.

Java 7 beats C++ and C in the the K-Nucliotide benchmark by 4 to 5 seconds.
http://shootout.alio...=java&lang2=gcc
Java 7 beats C++ in the fasta benchmark by ~1 second but loses to C by .1 seconds
http://shootout.alio...=java&lang2=gpp

C flat out wins or nearly ties vs C++ in everything except the K-Nucliotide test
http://shootout.alio...g=gcc&lang2=gpp

C when written properly beats C++ hands down.
The drawback of C is really that some more complex tasks are a pain to write without objects.

Java's main drawback is usually memory, but it's not as bad as most people think. Sure you have some where the Binary-Tree test ends up with Java taking nearly 5x the amount of memory C does, and on even small tests it still has to load a 10-15 meg virtual machine. However, somethings like the reverse complement test it takes nearly the same amount of memory as C does.

Java also attracted every programmer who was incapable of managing memory properly in C and C++ so there are a lot of bad memory structures out their in Java because at least it doesn't do the delayed crash thing C and C++ does when you mess with the memory the wrong way. Just because java has a garbage collector doesn't mean you can ignore memory, but that's what a lot of Java programmers do.

In Topic: C++ V.S Java for game programming.

24 January 2012 - 04:29 PM

If Windows doesn't ship with a JRE, then that's Windows fault, which is obvious since they are promoting .NET.


No Microsoft is forbidden from bundling a Java Virtual Machine with Windows due to being caught being evil. http://en.wikipedia.org/wiki/Microsoft_Java_Virtual_Machine

In Topic: C++ V.S Java for game programming.

24 January 2012 - 04:19 PM

C is best if you're going for speed.

C++ has many of the same slowdowns as Java does now. In fact today Java7 is about as fast as C++.

Java is in limbo in terms of support. The buyout of Sun by Oracle resulted in several years of Java 6 and left Java 7's updates out in the cold. Nothing like having to wait 5 years for a JSR updates that were ready to go to be integrated in. If Java 8 is released on time then that drawback is over, but if I have to wait 5 years again I will be upset.

Java tends to have outdated API's that people insist on trying to use in games, and API's that weren't tailored for games. For example Key Listeners that were intended for Swing Gui's don't work well in games. Java Sound has been neglected for years, and because of legal issues the JMF was abandoned along with MP3 support.

You'll need to get a real game api for java like lwjgl. Otherwise you're asking Java to do things in a way it wasn't designed for.

C and C++ is easier to port to consoles. XBox, Wii and PS3 do not have a real JVM supported for games. The PS3 has a slimmed down JVM for Blue-Ray functionality only.

PARTNERS