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.
Syncrous Messages
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Syncrous Messages
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
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