Re: Thread Pooling when using SoapService & SoapClient

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

DotNetFan_at_Community.nospam
Date: 10/07/04


Date: Thu, 7 Oct 2004 08:05:02 -0700

Harvey,

Did you identify source of thread creation & destruction? Have you already
fixed the problem?

Thanks

"Hervey Wilson [MSFT]" wrote:

> DotNetFan@Community.nospam wrote:
> > Harvey,
> >
> > Thanks for reply.
> >
> > Let me explain the problem in details.
> >
> > I am using the Serviceside object inherited from SoapService and client side
> > object inherited from SoapClient.
> >
> > You correctly identified that I am not creating any new threads. I am just
> > using WSE to invoke calls to Service every 5 seconds.
> >
> > You mentioned : "in general WSE doesn't create a new thread to handle either
> > clients or receivers, instead it uses threads from the threadpool to handle
> > events and process messages."
> >
> > We need make sure this statement is really true and that there is no bug in
> > case of soap.tcp. Unlike soap.http (which use infrastructure and settings of
> > IIS & ASP.Net enviornment), soap.tcp doesn't have such support from Forms
> > based projects. I am quite sure that these threads are created by WSE
> > classes. If I don't make any calls to Service, in timer_elasped handler, then
> > I don't see any exited threads in a VS window.
> >
> > This is not my real application, my real code is using Windows form on both
> > sides. This is a stripped down version to reproduce the problem. I get the
> > same behavior of creating and exiting from the new thread every 15 seconds,
> > even in Form based real application.
> >
> > I also disabled idleTimeout, sendTimeout,receiveTimeout,executionTimeout by
> > setting them to -1. But it didn't help.
> >
> > Could you reproduce the problem? Any further hints or directions?
> >
>
> There are no explicit thread creates anywhere in WSE2, although much use
> of made of the CLR threadpool for async results, wait callbacks and some
> timers. Given the resolution of 15 seconds, my suspicion is that this is
> coming from the message receive timeout engine which is not transport
> specific but bound to the SoapReceivers collection. The timeout engine
> uses a System.Threading.Timer at that 15 second resolution.
>
> The Framework documentation for this class indicates that it uses the
> threadpool, however that does not preclude the case that the threadpool
> is creating and destroying a thread to handle the timer callback.
> Clearly, if it's the timeout engine then the timer is being set
> unnecessarily in the case where timeouts are either disabled or no
> messages are being received.
>
> I'll investigate the initiation of the timer problem tomorrow and will
> also take a look at switching to a System.Timers.Timer to see if that
> alleviates the thread create / destroy. Any changes I make will appear
> in the SP2 build of the product.
>
>
> --
> This posting is provided "AS IS", with no warranties, and confers no rights.
>



Relevant Pages

  • Re: Thread Pooling when using SoapService & SoapClient
    ... coming from the message receive timeout engine which is not transport ... uses a System.Threading.Timer at that 15 second resolution. ... is creating and destroying a thread to handle the timer callback. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Timed event - problem
    ... is the timer callback in a different thread than the main prog ... equivalent to using a polling loop and defeats the purpose of using a timer. ... And can a timer callback be called while we are still in a different timer ... I believe a timer callback function is just a function. ...
    (comp.unix.programmer)
  • Problem with TimerCallback in.NET Compact Framework
    ... > In my application, I want to use timer callback,so that after a specified ... > time interval I'm able to do some logging operation continuously. ... > into the file stops and the timer no longer seems to be working. ... > Why is the timercallback not getting executed when I open any other ...
    (microsoft.public.dotnet.framework.compactframework)
  • Problems using System.Threading.Timer
    ... two Timer objects which control uptime of my apps. ... notify my apps to suspend and one is used to notify them to resume. ... The timer callback was invoked as expected... ...
    (microsoft.public.dotnet.csharp.general)
  • Re: Find user defined object
    ... of just destroying it at the end of the call, it might be worthwhile to start a ... self-destruct timer, with the object quietly imploding if the timer is reached, but ...
    (comp.soft-sys.matlab)