Page 1 of 1

Syncrous Messages

Posted: Sat Dec 27, 2014 8:40 pm
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.

Re: Syncrous Messages

Posted: Sat Dec 27, 2014 8:43 pm
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