Home AMX User Forum Duet/Cafe Duet
Options

com.amx.duet.util.Timer vs java.util.Timer

Does anyone has any experience with a lot of timers running concurrently? I get the impression that the reason to use the amx Timers is because of this Thread issue that AMX can't really explain any better than "Too many Threads is bad". AMX Timers run in a single Thread versus Java Timers each running in their own Thread. I am going to be making a lot of IP connections to Ethernet Serial Servers. Each connection uses 4 Timers; a delay after connection before you can send data, a response timeout, a time synchronization wait, and a failure timeout. I am worried that when I am trying to have 10 - 25 of these connections running concurrently I will have issues with that many timers running in one Thread. Most of the timers are not particullary critical that they are accurate except for the time synchronization wait. Anyone have any thoughts?

Comments

  • Options
    mighemighe Posts: 39
    You can safely use one java.util.Timer, you can schedule as many tasks as you wish in a single timer instance.

    I don't like very much com.amx.* packages because they bound the software to a very specific architecture, in my opinion java.util.* should be always preferred: this way we can test our program with a standard pc with Eclipse (or your favorite IDE), without wasting time waiting Netlinx to load everything.

    Remember to manage thread synchronization correctly, Java Memory Model is well defined, but very nasty and the AMX platform does not provide any helpful tool like java.util.concurrent package.
Sign In or Register to comment.