Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Single Threading a Web Service

Reply
Thread Tools

Single Threading a Web Service

 
 
Gregory_May
Guest
Posts: n/a
 
      04-19-2006
I am writing a web service to talk to a single threaded Com Componant. Is
there a simple way to single thread my Web Service so the Com Object doesnt
get confused?

Below is a stab:

<WebMethod()> _
Public Function MyWebService(ByVal MyParm As string)
Static Dim SyncObject As New Object
SyncLock (SyncObject)

SillySingleThreadedCOMObject.Method(MyParm)

End SyncLock

End Function


 
Reply With Quote
 
 
 
 
Josh Twist
Guest
Posts: n/a
 
      04-20-2006
That should work within an appdomain. If you want to synchronise access
to the COM object across the whole machine you'll need to use a mutex.

Why is the COM single threaded - is it a VB6 component running in an
STA? If so, you can usually just add the component to COM+ and you'll
get access to a lot more threads from the COM+ STA threadpool.

Josh
http://www.thejoyofcode.com/

 
Reply With Quote
 
 
 
 
Gregory_May
Guest
Posts: n/a
 
      04-20-2006
Thanks!

Its a 3rd party dll for talking to a piece of hardware.


"Josh Twist" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> That should work within an appdomain. If you want to synchronise access
> to the COM object across the whole machine you'll need to use a mutex.
>
> Why is the COM single threaded - is it a VB6 component running in an
> STA? If so, you can usually just add the component to COM+ and you'll
> get access to a lot more threads from the COM+ STA threadpool.
>
> Josh
> http://www.thejoyofcode.com/
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Re: threading in PyQt vs threading in standard library Steven Woody Python 0 01-09-2009 07:48 AM
threading in PyQt vs threading in standard library Steven Woody Python 0 01-09-2009 07:15 AM
Cooperative threading preemptive threading - a bit confused failure_to@yahoo.co.uk Java 9 12-29-2007 01:10 AM
Problem: My web service calls only open a single connection to the web service machine Scott Baierl ASP .Net Web Services 1 07-29-2006 01:16 AM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM



Advertisments