To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.javaOpen lugnet.robotics.rcx.java in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / Java / 162
161  |  163
Subject: 
LeJos threads / sleep() takes too long
Newsgroups: 
lugnet.robotics.rcx.java
Date: 
Wed, 6 Mar 2002 09:23:34 GMT
Viewed: 
3907 times
  
Experimenting with Lejos, two 'major' problems:
memory (cleaning up platform & lang: Math.class
is huge!) and... threads.

I have the impression my "try { sleep(nnn) }" takes
a somewhat arbitrary time. It's 'at least' nnn milisec,
but often much longer (particularly when sensorthread
has a lot of work, it seems). Is this 'standard' Java
behaviour? (not really into real-time programming)

It becomes very difficult to have a timed 'small
turn left' routine. Sometimes it turns a bit (as I want),
sometimes it makes a 180°. And no, I can't miss a rotation
sensor on this one (already 'overloading' sensors with light+touch etc)
I'm not expecting 100% precision, but this is not even close...

It seems a bit akward to go about and "implement" a
low-level sleep?! ( slicing sleep into 10ms and verify
system clock?)

Is thread-priority the problem here? (not clear if
higest-priority threads really 'yields()')

Any suggestions?

Thnx,
Bart



Message has 1 Reply:
  Re: LeJos threads / sleep() takes too long
 
Hi Bart, (...) if you mean LISTENER_THREAD then that sounds plausible. (...) Yes, LISTENER_THREAD has maximum priority, so it runs before any threads of lower priority, even yield doesn't help. (...) Yes, I think we'll have to fix that somehow. (...) (23 years ago, 6-Mar-02, to lugnet.robotics.rcx.java)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR