To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / *2229 (-20)
  Re: More on threads
 
(...) I recall that legOS's priority model is pretty rigid. If a thread with a higher priority never yields, threads with lower priority will never get any time. When I write legOS programs, I generally just have everything run at PRIO_NORMAL. That (...) (23 years ago, 19-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: More on threads
 
(...) Digging through tm.c gave me the impression, that main will indeed get no time slice. So I wrote another test program: ---...--- #include <conio.h> #include <unistd.h> pid_t worker; int work_task(int argc, char *argv[]); int main() { int i; i (...) (23 years ago, 19-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: More on threads
 
(...) ability to terminate but to run in an endless loop. But This is not true of an embedded system though which will have to run 'forever'. (...) priority of NORMAL+4. So, the (...) any time slice at all. NO time slice or just a very small chunk (...) (23 years ago, 19-Jan-02, to lugnet.robotics.rcx.legos)
 
  More on threads
 
(...) Of course you are right. I think it is a bad programming style not to give your program the ability to terminate but to run in an endless loop. But what is the penalty for this bad style? I've done some investigations and here are the results: (...) (23 years ago, 18-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: thread class for legOS
 
(...) IRC, every method in C++ has an implicit parameter wich is the object itself; that's why you can't cast it. Try the following (does someone have a nicer solution?): Put runWrapper() outside the class: int runWrapper(int, char **th) { (...) (23 years ago, 18-Jan-02, to lugnet.robotics.rcx.legos)
 
  thread class for legOS
 
I write a Thread class for LegOs with a simple interface like in Java or CommonC++. I'm using LegOs 0.2.4. Below are my work till yet. The problem is in the Method Start(). The line is marked with !!. The error message is at the end of the file. I (...) (23 years ago, 18-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: LNP Routing daemon with tcp/ip for RCX/legOS, Cybermaster/NQC
 
"Freddy" <mail-nowak@web.de> schrieb im Newsbeitrag news:GpzyB6.Kpt@lugnet.com... (...) A C++ class to build client application without knowing the LNPoI protocol is available for Windows and Linux now. (URL) (23 years ago, 18-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
(...) I would strongly suggest changing this to while(1) msleep(bignumber);. Otherwise you're hogging the processor doing nothing important, which could do bad things to any compute-intensive tasks you may have going. It'll also use slightly less (...) (23 years ago, 18-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
Hi Ross (...) you (...) What are the advantages and disadvantages of this method as opposed to the one I used? mike (23 years ago, 18-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
(...) Note also since bumper_task() is an infinite loop, and you never use pid1, you could save one thread by doing this: int main(int argc, char *argv[]) { pid2 = execi (&left_task, 0, NULL, PRIO_NORMAL+2, DEFAULT_STACK_SIZE); pid3 = execi (...) (23 years ago, 17-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
;-) That worked a treat, thanks Michael. (thanks for the other little corrections in the code too). mike (...) Mike, (...) your subroutines and then you leave main()! Leaving main means (...) memory is freed. The following will do the job: (...) (...) (23 years ago, 17-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
Hi Mike, your problem is not because of an error in legOS. But what you do is that you start your subroutines and then you leave main()! Leaving main means that all your allocated memory is freed. The following will do the job: ---...--- cut here (...) (23 years ago, 17-Jan-02, to lugnet.robotics.rcx.legos)
 
  IRC
 
Anyone who is a regular user of IRC can join my channel #LegoMindstorms (on dalnet). Coma and chat or give/recieve assistance. If you join you are welcome to Ops because anyone in here will know more about Mindstorms than me as i know almost (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)  
 
  Re: threads
 
Albert (...) yea, I see what you are getting at. I am sure that I was hitting the bumper while the threads were still alive, but I will check again. I think this also points out some of the dangers of just dumping in some poorly thought out dummy (...) (23 years ago, 17-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
(...) As pointed by Albert Huang, you cannot call kill() with an "invalid" pid. Actually, the comment above kill() in tm.c says: //! kill a process /*! \param pid must be valid process ID, or undefined behaviour will result! The function updates (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads
 
two of your threads terminate shortly after being started (...) as far as I know, legOS provides no functionality for determining whether or not a thread is alive or not. You need to keep track of this yourself (e.g. using a variable/flag that gets (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads - bug in the firmware?
 
Hi again I have now totally stripped down my code to a minimum and I am still having problems with the code hanging up. I can see nowhere where there can be a fault. I am a long way from being an expert, but is it possible there is a bug in the (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: Cygwin problems
 
Ben I recommend you read the Howto from the sourceforge docs section, or even better buy the Extreme Mindstorms book (Extreme Mindstorms; D. Baum, M. Gasperi, R. Hempel, L. Villa; Apress; ISBN: 1893115844 ) . Both give a good explanation of legOS. (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)
 
  Cygwin problems
 
Hi all, i am having problems with cygwin. It doesnt help that i dont know what all these linux commands mean but i will explain my problems now. I have intstalled all the software to my system ok and the linux emulator seems to work fine(i can use (...) (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: threads
 
Thanks Albert (...) still (...) How do I check this? There are no other tasks that can kill threads apart from this one. I also checked process IDs after creation and before killing. Best regards, mike (23 years ago, 16-Jan-02, to lugnet.robotics.rcx.legos)


Next Page:  5 more | 10 more | 20 more

Redisplay Messages:  All | Compact

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