|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Configure Timers
I generally don't go and make my own spoon before I go to eat some soup.
That being said, I have tried to strongarm the Squawk VM running on the cRIO. An instance of Timer will handle execution of all of its TimerTasks. If you want, you can make instances of Thread and run them asynchronously from the main robot code. I would point out that you can't really guarantee the length of a timeslice unless you have ring 0 privileges. In this case, you could argue ring 0 privileges are JVM-level, but the JVM has a lot of overhead (compared to modern ones). I would say a timeslice of less than 15ms will be impossible to guarantee. And everyone seems to bring up JNI. Has anyone who says that actually tried to use it? It'd be even harder on something like a FIRST-compliant cRIO, where you have huge restrictions on what you can do with the thing (not saying it'd be impossible, but more of a pain than usual). |
|
#2
|
||||
|
||||
|
Re: Configure Timers
Quote:
|
|
#3
|
|||
|
|||
|
Re: Configure Timers
I'm trying to say that this whole argument is basically futile because of the lack of control you have over the JVM and its scheduling. What control you do have you can not apply to the precision that is wanted.
Most tasks should be run by a Timer as TimerTasks. If you want to try to run something faster, use a Thread, but you will not be able to guarantee execution timing. |
|
#4
|
||||
|
||||
|
Re: Configure Timers
Which "argument" are you referring to? There are many different things being discussed here; many of them are not rendered pointless by your scheduling comment.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|