[riot-users] Parallel threads
Janna_OM at hotmail.com
Mon May 14 12:29:30 CEST 2018
i‘m trying to emulate parallel thread execution to send and receive messages simultaneously in my application.
I have two threads. The main thread with priority 7. It creates and sends messages in while loop with gnrc_netapi_send() function.
The second receiver thread has priority 6 and receives messages in while loop with function msg_receive().
When the application running, there is no context switch. There are only messages sent from the first thread,
or only messages received from the second thread, depending on what starts first.
Currently I solved the problem by calling xtimer_sleep() function after after gnrc_netapi_send().
Is there a better solution to achieve the parallel execution emulation?
Would be glad about any advice.
Thank You in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users