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 / 2737
Subject: 
is it possible to remove lnp_handler while running ?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 16 Jul 2002 15:45:46 GMT
Viewed: 
1978 times
  
another dumb question about lnp:)

i was wondering if it possible to do something like
lnp_addressing_remove_handler(PORT,handler);
as opposed to lnp_addressing_set_handler(PORT,handler);

after much debugging i think i have traced my problem to the fact that
lnp_addressing_write hangs if i recieve a message at the same time as i
try to send.

so i kinda wondered if theres any way to remove the handler for a while
and then set it again.

anyone know ?

regards
kenneth johansen
kennethj@stud.cs.uit.no


Subject: 
Re: is it possible to remove lnp_handler while running ?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 16 Jul 2002 16:55:04 GMT
Viewed: 
2015 times
  
"kenneth johansen" <kennethj@stud.cs.uit.no> wrote in message
news:3D343FAA.17247640@stud.cs.uit.no...
another dumb question about lnp:)

i was wondering if it possible to do something like
lnp_addressing_remove_handler(PORT,handler);
as opposed to lnp_addressing_set_handler(PORT,handler);

after much debugging i think i have traced my problem to the fact that
lnp_addressing_write hangs if i recieve a message at the same time as i
try to send.

so i kinda wondered if theres any way to remove the handler for a while
and then set it again.

anyone know ?

regards
kenneth johansen
kennethj@stud.cs.uit.no



I imagine you could just do something like

lnp_addressing_set_handler( PORT,  (lnp_addressing_handler_t) NULL );

I'm also curious as to why lnp_addressing_write hangs for you... I don't
remember ever having problems with two bricks reading and writing
concurrently.


Subject: 
Re: is it possible to remove lnp_handler while running ?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 16 Jul 2002 17:49:23 GMT
Viewed: 
2077 times
  
heh.. tried that.. no luck :(
sigh..after yet a couple of hours trying to figgure this out, im 99,99% sure
that the problem is in lnp_addressing_write.
could this be that the function is not thread safe ?
but then again i have protected the function with mutexes (to ensure that i
had no context switch while it tries to send)and it still didnt work.
gah.. im getting desperate here

im obvisouly missing something important here, but i cannot se it :(


ps: sending and recieving at the same time is has no problem after all :)

regards
a desperate kenneth johansen
kennethj@stud.cs.uit.no


I imagine you could just do something like

lnp_addressing_set_handler( PORT,  (lnp_addressing_handler_t) NULL );

I'm also curious as to why lnp_addressing_write hangs for you... I don't
remember ever having problems with two bricks reading and writing
concurrently.


Subject: 
Re: is it possible to remove lnp_handler while running ?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 16 Jul 2002 17:59:25 GMT
Viewed: 
2051 times
  
no..wait.. im fairly sertain that i did have a context shift while in
lnp_addressing_write..after all .could that be why it never returns ?

Falco, i tried looking at your thread safe example in emulegos, but im
afraid i didnt understand much of it.....

ill do my best to se if i can create a thread safe lnp_addressing_write
function.. but im not sure if im up to the task :(

if anyone here knows how to do this id really appriciate the help

regards
kenneth johansen
kennethj@stud.cs.uit.no

Albert Huang wrote:

"kenneth johansen" <kennethj@stud.cs.uit.no> wrote in message
news:3D343FAA.17247640@stud.cs.uit.no...
another dumb question about lnp:)

i was wondering if it possible to do something like
lnp_addressing_remove_handler(PORT,handler);
as opposed to lnp_addressing_set_handler(PORT,handler);

after much debugging i think i have traced my problem to the fact that
lnp_addressing_write hangs if i recieve a message at the same time as i
try to send.

so i kinda wondered if theres any way to remove the handler for a while
and then set it again.

anyone know ?

regards
kenneth johansen
kennethj@stud.cs.uit.no



I imagine you could just do something like

lnp_addressing_set_handler( PORT,  (lnp_addressing_handler_t) NULL );

I'm also curious as to why lnp_addressing_write hangs for you... I don't
remember ever having problems with two bricks reading and writing
concurrently.


Subject: 
Re: is it possible to remove lnp_handler while running ?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 16 Jul 2002 18:29:01 GMT
Viewed: 
2275 times
  
Have you tried the 0.2.6.05 ?? I remember something in this area while I was
debugging RCX message passing. There is a different semaphone for the xmit
buffer separate from the transmitter (TX) in 0.2.6.05 that was not so in
0.2.6

The very latest lnp code (beyond 0.2.5.05) is checked into CVS but not in
any kit yet.

/ted

"kenneth johansen" <kennethj@stud.cs.uit.no> wrote in message
news:3D345CA3.C59431F9@stud.cs.uit.no...
heh.. tried that.. no luck :(
sigh..after yet a couple of hours trying to figgure this out, im 99,99% • sure
that the problem is in lnp_addressing_write.
could this be that the function is not thread safe ?
but then again i have protected the function with mutexes (to ensure that • i
had no context switch while it tries to send)and it still didnt work.
gah.. im getting desperate here

im obvisouly missing something important here, but i cannot se it :(


ps: sending and recieving at the same time is has no problem after all :)

regards
a desperate kenneth johansen
kennethj@stud.cs.uit.no


I imagine you could just do something like

lnp_addressing_set_handler( PORT,  (lnp_addressing_handler_t) NULL );

I'm also curious as to why lnp_addressing_write hangs for you... I don't
remember ever having problems with two bricks reading and writing
concurrently.



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