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 / 2375
2374  |  2376
Subject: 
Re: Proposal: int program_running()
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 20 Mar 2002 22:25:05 GMT
Viewed: 
1812 times
  
In lugnet.robotics.rcx.legos, Joseph Woolley writes:
I have noticed several places in the kernel where nb_tasks is used to see if
a program is running.  Currently, nb_tasks > 3 means that a program is
running and <= 3 means that just the kernel processes are running.

I would like to propose that the following inline function (or if necessary,
macro) be used instead.  This would likely be placed in program.h within
#ifdef CONF_PROGRAM ... #endif

inline int program_running() {
return (nb_tasks > 3);
}

This would allow easy modification (if perhaps another kernel task was
introduced  or  a new method was developed for program tracking).

Any comments or suggestions?  I would make the patch myself, but am not
familiar with the tools to do so.

I've thought about this before but never did anything 8?( I think I'd prefer a
macro, thus removing the need for #ifdef. Although you wouldn't want the #ifdef
anyway, as you need to call it in the kernel, and #ifdefing it out would be
rather deterimental 8?)

ROSCO



Message has 1 Reply:
  Re: Proposal: int program_running()
 
I know it is fairly trivial, but it is a start. I am working on some other things... hopefully to be included either in patch form or in 0.2.6 (if/when it comes about). I like the idea of the inline function best, but will leave that up for debate. (...) (23 years ago, 21-Mar-02, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Proposal: int program_running()
 
I have noticed several places in the kernel where nb_tasks is used to see if a program is running. Currently, nb_tasks > 3 means that a program is running and <= 3 means that just the kernel processes are running. I would like to propose that the (...) (23 years ago, 20-Mar-02, to lugnet.robotics.rcx.legos)

4 Messages in This Thread:

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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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