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 / 1646
1645  |  1647
Subject: 
Re: LegOS 0.2.5 and LNP
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sun, 21 Jan 2001 15:36:09 GMT
Viewed: 
1456 times
  
"Paolo Masetti" <paolom@pragmanet.it> writes:

I think that we can use safely (CONF_TM || defined CONF_HOST)
condition.

I'm checking the whole patch and I think that it could be
realeased soon.

Ok.  Checking and testing never hurts :-).

I'm just wondering:

1) Why have you used

+  lnp_integrity_handler_t intgh;
+  lnp_addressing_handler_t addrh;

in lnp_receive_packet(), apart from a very little optimization or
something I can't see? :-)

It's not for performance, but for correctness.  The old code was like this:

    if(lnp_addressing_handler[port]) {
...
lnp_addressing_handler[port](data,length-2,src);

You first test lnp_integrity_handler and then, before using it, you reload
it from memory.  If the value has changed (and it could on a PC, as you are
not in an interrupt handler) you have problems.  The right thing is to read
once and use twice.  Probably if there are no function calls in place of
"..." (but in 0.2.5 there may be one) the compiler will optimize it and
read only once, but it's better to force the compiler to do what you want
with actual code.  For the same reason I added the volatile attribute.

2) I can see that you do not have any sem_destroy() for buf_sem,
so I will probably introduce a lnp_shutdown() function that will
to destroy it. That function wasn't required before buf_sem
introduction.

Good idea.  Lacking of sem_destroy() causes no trouble on many platforms,
as it does nothing, but it's better to be on the safe side.

bye
Bernardo



Message has 1 Reply:
  Re: LegOS 0.2.5 and LNP
 
(...) was like this: (...) you reload (...) PC, as you are (...) thing is to read (...) place of (...) optimize it and (...) what you want (...) attribute. Yes, but I'm not sure what could happen if I change those addresses in the middle of the (...) (24 years ago, 22-Jan-01, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: LegOS 0.2.5 and LNP
 
(...) you may see (...) give access (...) the handlers (...) My only (...) depend on. (...) introduce a (...) this point to (...) I think that we can use safely (CONF_TM || defined CONF_HOST) condition. I'm checking the whole patch and I think that (...) (24 years ago, 21-Jan-01, to lugnet.robotics.rcx.legos)

9 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