[riot-devel] UDP datagram sending

Mateusz Kubaszek mathir.km.riot at gmail.com
Tue Jun 7 11:26:10 CEST 2016


 > can you elaborate on how it "doesn't work"?

After the message is sent, the reading thread doesn't receive it. I have 
been watching what is going on in "gnrc_netapi_dispatch" function. The 
destination pid is correct and there wasn't a problem with message 
sending. Destination PID is 6 which is the udp thread (I put there a 
printf statement indicating any incoming message).

I finally resolved the problem yesterday's night. I was certain about 
it, but now I repeated a couple of tests and I don't know why it is 
working properly... The UDP thread's priority equals 5, the same 
priority has my sending thread. After I lowered my thread's priority to 
be lesser than udp's (lets say 6) all began to work properly. Today I
retried the test and all seems to work no matter what my thread priority 
is. So maybe there was another bug in my code. Sorry to bother you.

But I have two more things that puzzles me. Why the program is aborting 
as a result of memory access violation after my thread has been:
1) Initialized with flag THREAD_CREATE_WOUT_YIELD
2) Has lower or the same priority as main thread from which it was created.

The platform I am running my program on is native (Linux).

More information about the devel mailing list