Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dsdp-tcf-dev] Send an event from a worker thread

Hi,

Is there an other way to send event on a channel beside to use post_event()? I'm asking that because by doing this, only the "main" thread can send data. Is there a way to use multiple connexion to the agent and send data simultaneously to these connexion from multiple thread? It would be beneficial if a given server had many network cards.

Thanks

Michael

Tarassov, Eugene wrote:
Hi Michael,

Yes, using post_event() is the right way to send a tcf event from a
background thread.
Also, if a background thread will hold a pointer to a channel struct,
you should use stream_lock()/stream_unlock() to prevent the struct from
being freed.

Regards,
Eugene

-----Original Message-----
From: dsdp-tcf-dev-bounces@xxxxxxxxxxx
[mailto:dsdp-tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Michael
Sills-Lavoie
Sent: Friday, June 05, 2009 6:44 AM
To: DSDP TCF dev list
Subject: [dsdp-tcf-dev] Send an event from a worker thread

Hi!

I would like to know what is the right way to send a tcf event from a
worker thread in the C agent?

What I'm considering right now is to post an event from the worker
thread(a thread that is not the dispatch one) with the TCFBroadcastGroup
or a specefic channel as parameter.

Then, in the callback function, I would send the data that the thread
wanted to send on the channel (the data would be send in a protected
queue or something like that).

Is this the best way to send data in an event from a thread?

Thank you.

Michael
_______________________________________________
dsdp-tcf-dev mailing list
dsdp-tcf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-tcf-dev
_______________________________________________
dsdp-tcf-dev mailing list
dsdp-tcf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-tcf-dev



Back to the top