As I mentioned on the old board, there is the chance the new Linux Kernal (sorry Kernel
!) might fix the thread problem.
High performance threading turns up in version 2.6 (or version 3.0 if they decide to change the name) and here is a bit of an article for your interest:http://www.onlamp.com/pub/a/onlamp/2002/11/07/linux_threads.html
Anybody been able to try it with Java yet?? (Not even sure if it's available yet.) http://www.kernel.org/
does not seem to have it.
Utterly disapointed with the sound syncing system, it may be that it works fine on some JVM's though, as I never tried it with IBM's JVM.http://www-106.ibm.com/developerworks/java/
At the end of the day the only system that works reliably (when given 100% cpu) is running unlimited, which is what I use as a fall back method.
But this means using Doubles/Floats/1.15.16 fixed point for all your counters, co-ords etc which can look messy because this means you have to deal with 1.5 pixels of travel rather than just whole integers.
Threads can behave very wierdly, if you sync on one they are typically stable (+-5% variation), if you don't sync on them (say your frame rate drops below 60Hz) then expect the Thread to become unstable (-15% so 60Hz drops to 51Hz).
This really annoys me as ALL IBM compatable PC's (from the very first 64K tape machine upwards) have a 8253 timer chip in (PC speaker) which gets a 1,193,180Hz signal from the PC's oscilator (8284 I believe). And can be read (albeit as a 16 bit counter, but that is not difficult to get round).
Want to know how many bytes this code takes?
I8_Ctrl_Port EQU 043h
I8_T2_Port EQU 042h
in al,I8_T2_Port ;Get Low Byte Of Counter.
in al,I8_T2_Port ;Get High Byte Of Counter.
[b]Can even be done in Turbo Pascal![/b]
Port[ $43 ] := $04;
Read_Timer :=( Port[$42] SHL 8 )+ Port[ $42 ];
Thats about 14 bytes that execute in under 30 clock cycles ( Port IO is still very slow). And do they use it? Do they hell...
What you need to be thinking about is where are the hi-res timers located within a PC, most of them are off limits because of Java, but there must be a way to access the high res timer in the network card.
I'm sure the TCP/IP packets get date stamped, what if you could route out a packet that was received imediately and read the time fields (but I don't think this is accessable in Java). But interestingly you can set/catch a timeout value (unstated accuracy - could be minutes!).
Have not had the time to try it yet, anybody want to have a go?
ServerSocket.SetSoTimeout( int ); Looks interesting, available in JDK1.1 too.
public void setSoTimeout(int timeout) throws SocketException
Or some variation on this? Probably causes a security exception in Applets through...
All the best,