|
-
May 27th, 2002, 08:58 PM
#1
Exchanging Data Between Threads
Hi,
I am new to this topic so please excuse any glaring mistakes.
I have a COM Object which is recieving requests from a client. I am using events created in a worker thread to notify the worker thread when to do some of these requests. The result of the request is passed back to the client through a connection point container interface on my COM Object. There is one flaw with this above strategy, how do I pass the data I recieved from the client (in the interface's functions arguements) to the worker thread?
That is how do I do data exchange between two threads?
Any help would be greatly appreciated.
Thanks.
Needaname16
-
May 28th, 2002, 10:13 AM
#2
When you create a thread, you have a lpParam parameter in CreateThread. You can pass the address of a structure which contains all data the main thread and the worker need to use in common. The worker recieves this address in the PVOID parameter to the ThreadProc.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|