PC Review


Reply
Thread Tools Rate Thread

COM and MultiThreading

 
 
Murad Tchary
Guest
Posts: n/a
 
      22nd Feb 2004
Hi
Here is the code that I use in my app and that code works just fine:

loProcessThread = New Thread(AddressOf ProcessSomething)
loProcessThread.IsBackground = True

loProcessThread.Start()

'Wait until some data will be ready to be use ...
Do
If llSomeDataAreProcessed Then
Exit Do
Else
Thread.Sleep(100)
End If
Loop

But, when I try to use the same code in a COM - it does nothing. My base
class inherits System.EnterpriseServices.ServicedComponent .
Is it possible to use multithreading in COM? If yes, what should be done?

TIA


 
Reply With Quote
 
 
 
 
Valery Pryamikov
Guest
Posts: n/a
 
      22nd Feb 2004
Of course it is possible to use multithreading with COM, if you do it right.
I suspect that your problem is STA threading model of your COM component.
Check this:
http://discuss.microsoft.com/SCRIPTS...0&I=-3&P=42806
for more information.

-Valery
http://www.harper.no/valery

"Murad Tchary" <(E-Mail Removed)> wrote in message
news:uJo93FY%(E-Mail Removed)...
> Hi
> Here is the code that I use in my app and that code works just fine:
>
> loProcessThread = New Thread(AddressOf ProcessSomething)
> loProcessThread.IsBackground = True
>
> loProcessThread.Start()
>
> 'Wait until some data will be ready to be use ...
> Do
> If llSomeDataAreProcessed Then
> Exit Do
> Else
> Thread.Sleep(100)
> End If
> Loop
>
> But, when I try to use the same code in a COM - it does nothing. My base
> class inherits System.EnterpriseServices.ServicedComponent .
> Is it possible to use multithreading in COM? If yes, what should be done?
>
> TIA
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multithreading in ASP.NET app??? JV Microsoft ASP .NET 29 22nd Mar 2006 01:55 PM
Multithreading in ASP.NET app??? JV Microsoft Dot NET 28 22nd Mar 2006 01:55 PM
Multithreading in ASP.NET app??? JV Microsoft C# .NET 28 22nd Mar 2006 01:55 PM
Multithreading Hugh Janus Microsoft VB .NET 6 24th Jan 2006 01:22 AM
Multithreading =?ISO-8859-2?Q?Marcin_Sm=F3=B3ka?= Microsoft C# .NET 5 14th Nov 2003 03:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:20 PM.