Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2005

Tip: Looking for answers? Try searching our database.

simultaneous calling COM object method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jarylka@gmail.com - 13 Sep 2005 17:20 GMT
Hi, all.

Excuse me for my English.

I have ASP.NET web service with one method "Test".
This method "Test" invoke COM object method "Sleep".
And COM object method "Sleep", in one's turn, call procedure "Sleep"
from Windows API.
If I make 2 simultaneous call of method "Test" (web service) then
observe next scene: All call executes "one after another".

But,
Web service ApartmentState: MTA.
COM object ThreadingMode: Free

For instance,
During first call:
 web service method thread ID - 1003
 COM object method thread ID - 1003
During second call:
 web service method thread ID - 2756
 COM object method thread ID - 2756

Where is a bottleneck?

Thank you.
Robert Jordan - 13 Sep 2005 17:32 GMT
> I have ASP.NET web service with one method "Test".
> This method "Test" invoke COM object method "Sleep".
[quoted text clipped - 16 lines]
>
> Where is a bottleneck?

What bottleneck? From this log I can only deduct that each request
gets processed by another thread. That's normal.

Rob
Jarylka@gmail.com - 13 Sep 2005 17:39 GMT
Second thread obtain access to COM object method only after first
thread leave COM object method code!!!
Robert Jordan - 13 Sep 2005 18:10 GMT
> Second thread obtain access to COM object method only after first
> thread leave COM object method code!!!

How do you log?

ciao
Rob
Jarylka@gmail.com - 14 Sep 2005 07:24 GMT
> > Second thread obtain access to COM object method only after first
> > thread leave COM object method code!!!
>
> How do you log?

COM object write debug infomation to log file.
Web service return debug info as result string.

During first calling sleep parameter set up to 10000 ms.
During second call - 1000 ms.
Second call return result after ~ 11000 ms.
Robert Jordan - 14 Sep 2005 09:44 GMT
>>>Second thread obtain access to COM object method only after first
>>>thread leave COM object method code!!!
>>
>>How do you log?
>
> COM object write debug infomation to log file.

Are you sure that the log method doesn't snychronize the threads?

> Web service return debug info as result string.

You should use Context.Trace.Write (....) of your WebService,
and don't log something to file from your COM object, unless
you can assure it is totally asynchronous.

Rob
Jarylka@gmail.com - 14 Sep 2005 11:17 GMT
> >>>Second thread obtain access to COM object method only after first
> >>>thread leave COM object method code!!!
[quoted text clipped - 4 lines]
>
> Are you sure that the log method doesn't snychronize the threads?

Even if the log method calling synchronizes the threads the lion's
share of loss of time accounts for "Sleep" procedure.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.