Bidirectional Spontaneous Event Design Pattern

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
gcore
New User
Posts: 3
Joined: Thu Oct 06, 2016 4:58 am

Bidirectional Spontaneous Event Design Pattern

Postby gcore » Thu May 18, 2017 7:40 am

Hi all,

I'm trying to design a Bidirectional Spontaneous Event Design Pattern where the main application would create an array of channels, pass all of them to one task that would be the Message Master, and the other end of each channel to a respective Task. The tasks would each identify themselves with the Message Master, and then would all be able to do whatever job they needed, and send events to each other ad hoc via the Message Master task. This would avoid the need to sacrifice chanends for connections between any two arbitrary tasks, but at the expense of highly determinate low latency communication which is a trade-off I'm happy to live with.

Pretty much what is mentioned at this link:
http://www.xcore.com/viewtopic.php?f=26&t=2392&p=15050

I've tried a number of iterations of implementing this, including using module_mutual_thread_comm from the sc_util library mentioned on that page, but still haven't found a solution that properly gets the job done. I've satisfied myself that module_mutual_thread_comm can be used between two tasks, each hammering the other with no data loss or deadlock. I'm yet to have the same success if I add a third task, with one task dedicated to being the Message Master allowing the other two tasks to communicate with each other via it.

This sort of design pattern is something that I've used in a number of other firmware development tasks on other platforms. For example, multiple threads on a Linux system, all able to send events to each other. I'm hoping to implement at least a rudimentary but robust messaging scheme on XMOS.

Could anyone recommend an approach, or an existing library for achieving this design pattern between N tasks on different cores and tiles on an xCORE-200 device?

Return to “Development Tools and Programming”

Who is online

Users browsing this forum: No registered users and 10 guests