|
-
February 2nd, 2005, 04:06 AM
#1
AfxBeginThread
Iam creating a worker thread using AfxBeginThread inside a COM Inproc DLL and when i call the particular function through the thread it take more CPU time than
the one without a thread.....why is this happening ?
-
February 2nd, 2005, 04:31 AM
#2
Re: AfxBeginThread
When you create the worker thread, what is it doing when it has no work to do? Is it in a tight loop waiting for work, or does is suspend itself until its told that more work is available?
Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
Please remember to rate useful answers. It lets us know when a question has been answered.
-
February 2nd, 2005, 04:39 AM
#3
Re: AfxBeginThread
I call a particular global function through the AfxBeginbthread.
I give a Normal priority for this message.
When i click a mouse button this thread will be started and it does not wait
for anything.
-
February 2nd, 2005, 05:44 AM
#4
-
February 2nd, 2005, 11:24 AM
#5
Re: AfxBeginThread
Sounds like some sort of COM marshalling is going on.
In single apartment threaded COM objects the calls to methods are marshalled - i.e. the methods aren't actually called directly but run through a 'seperation' mechanism.
If you start up your app in a multi threaded apartment mode and enable your com object to support 'both' single & multi threaded apartments I think you'll find that it won't slow down.
Darwen.
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
|