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 / 1867
1866  |  1868
Subject: 
API changes
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 10 May 2001 19:02:38 GMT
Viewed: 
1405 times
  
In using legOS, I've found that many of the design decisions seem
somewhat backwards, and I think that this is due to a desire to keep the
interface as similar as possible to NQC. I was wondering what people
would think about changing the core API to be more along the lines of
what someone familiar with UNIX would be expecting. (Maintaining
backwards compatability via helper functions which could be selectively
compiled.) Specifically, some of the things that I have in mind are:

* Calling threads "threads" rather than "processes", and starting them
   via pthread_create() or some such, rather than execi().

* Thread synchronization in the style of pthreads. (eg. mutexes,
   condition variables, etc)

* Having the motor and sensor access functions take a parameter
   specifying which motor/sensor to access, rather than having the
   selection be in the function name. (ie. motor_speed_set(MOTOR_A, 100)
   rather than motor_a_speed(100)).

* Functions (or perhaps function-type macros) instead of volatile
   global variables. eg. time() rather than sys_time.

* Networking API which works similarly to sockets, with read() and
   write() calls, rather than a callback for recieving data.

Let me know what you think about this.
--matt



Message has 2 Replies:
  Re: API changes
 
(...) These seems to me good ideas. Adding errno would also be useful. bye Bernardo New e-mail: dibbe@freestation.it (24 years ago, 10-May-01, to lugnet.robotics.rcx.legos)
  Re: API changes
 
My only concern with these proposed changes is possible increased memory usage. Encapsulation, error reporting, thread synchronisation etc are nice; but with just 32k of RAM I would question whether these are appropriate for some applications. For (...) (24 years ago, 11-May-01, to lugnet.robotics.rcx.legos)

6 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