Syncrous Messages

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Syncrous Messages

Post by Tabulous »

Hi
in my application i have multiple threads acting as services i.e. SMS, HTTP, FTP etc etc

These services i'm looking to use by passing messages(structs passed by pointer) to them, but to do this one needs to know the thread pointer of the thread.

What is the best way to manage this ?

You could have a array of thread pointers that are initialized when the threads are created, but was not sure if this is the best solution to the problem.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Syncrous Messages

Post by Giovanni »

Hi,

It is the correct approach, the create thread function returns a pointer that can be used as destination for messages, give the pointers appropriate names at it will look very natural, for example "http_server" or similar.

Giovanni
Post Reply