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 / 1645
1644  |  1646
Subject: 
Re: LegOS 0.2.5 and LNP
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sun, 21 Jan 2001 14:50:25 GMT
Viewed: 
1273 times
  
I cleaned up my code (found one bug!), the patch follows.  As • you may see
now there are two semaphore, because two are the resources to • give access
to: the LNP buffer and the IR port.  I modified the calling of • the handlers
to avoid race condition in a multithead envinronment on a PC. • My only
worry is the symbol the semaphore-related code in lnp.c should • depend on.
I used the conditional

#if defined CONF_TM || defined CONF_HOST

Perhaps that breaks something in the utilities and we should • introduce a
new symbol (CONF_HOST_TM?), I don't know for sure.  I leave • this point to
more savvy people.

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.

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? :-)

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.

Any feedback?

Bye,
     Paolo.

---
Bombs don't kill people, explosions do.



Message has 1 Reply:
  Re: LegOS 0.2.5 and LNP
 
(...) Ok. Checking and testing never hurts :-). (...) It's not for performance, but for correctness. The old code was like this: if(lnp_addressing_ha...ler[port]) { ... lnp_addressing_handl...th-2,src); You first test lnp_integrity_handler and then, (...) (24 years ago, 21-Jan-01, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: LegOS 0.2.5 and LNP
 
(...) I cleaned up my code (found one bug!), the patch follows. As you may see now there are two semaphore, because two are the resources to give access to: the LNP buffer and the IR port. I modified the calling of the handlers to avoid race (...) (24 years ago, 20-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