Re: Threading Delay



The max is 512. The general case, user settable, is more like 32. Anything
above 64 is research at present. ANd the symptoms seem to appear mostly,
after many of the threrads have already exited. For instance, if 64 threads
were allowed, after 43 of them were finished, when the 44th exits there
would be a minute of seemingliy nothing going on then the rest all exit
normally with no delay or some may have the delay. I will look at the page
faults. This may help show the problem. Thanks for the tip.

"Jimmy" <jim_klos@xxxxxxxx> wrote in message
news:OwnhBKgOFHA.2788@xxxxxxxxxxxxxxxxxxxxxxx
> 1) 512 threads is ridiculous, but you say "of varying sizes", and you see
> this only occasionally, so it may be a low-resource situation... important
> system tables being paged-out, then paged-in. Do you see the problem with
a
> reasonable number of threads, like 4?
>
> 2) Set up a dual-machine kernel-debugging situation with WinDbg, run your
> app with 512 threads, and when you see the delay, break into debuggee
> machine... the WinDbg help tells how to track down a cpu-hog. (Oh, you
did
> not mention that cpu utilization was 100%... well, if upper-management
> approved this design, then it is a good reason to get another machine, if
> only to show that it will not work!!)
>
> 3) Use Task Manager, display Page Faults Per Second -- if the problem is
> that important system tables are being paged-out, this number should go
up,
> especially if the system is thrashing.
>
> 4) Use a profiler like VTune -- it might show where most of the time is
> being spent.
>
> 5) I hope this 512-thread app is a research project or for
> internal-use-only!!! If everyone wrote apps that used 512 threads... it's
> the same thing as when everyone raises the priority of their processes!!!
>
> "Rob Smitter" <rsmitter@xxxxxxxxxxxx> wrote in message
> news:eo3jRhfOFHA.904@xxxxxxxxxxxxxxxxxxxxxxx
> > I am confused about the action when threads terminate. I am having a
> > problem where, on exit of a thread, the system seems to hang for
variable
> > amounts of time, from nothing noticeable to sometimes over a minute. In
> > most cases it is not noticeable
> >
> > Some background:
> >
> > I have an app that builds up thread pool of varying sizes, up to 512
> > threads. Each thread grabs it data from a queue. When the thread tries
> to
> > get the next item from the queue, if the queue is empty, the thread
> > function exits. Each thread is started with beginthreadex. After the
> > thread is terminated CloseHandle is called. From the documentation it
> looks
> > like there is no need to call _endthreadex as it is called when the
> thread
> > function terminates. The queue is filled up before the pool is started
> >
> > I have logged the exiting of the thread along with other thread activity
> and
> > from the log I can see the delay and it always shows up, if it shows up
at
> > all, when the thread exits.
> >
> > Is there a reason for this behavior? It also seems to happen more when
> the
> > thread pool is mostly shutdown. But not always. Sometimes it runs with
> no
> > delays. Is it related to the amount of the vitrtual memory used, actual
> > memory used or ?
> >
> > Thanks for any hints to help me understand this.
> >
> >
> >
>
>


.



Relevant Pages

  • Re: Is this a race?
    ... like an actual delay would. ... and re-scheduled it on the time queue for a time 0 away from now, ... essentially needed to specify that #0 would defer a process to the end ...
    (comp.lang.verilog)
  • Re: App does not become frontmost?? Delay in InitInstance
    ... My *real* application has no actual 35 second delay in it. ... involved when using this app. ... > the introduction of a gratuitous 35-second startup delay. ...
    (microsoft.public.vc.mfc)
  • Re: App does not become frontmost?? Delay in InitInstance
    ... >My *real* application has no actual 35 second delay in it. ... running a compute-intensive app takes 15 seconds. ... so I don't want anyone saying "It's all the fault of WIndows"). ... >> the introduction of a gratuitous 35-second startup delay. ...
    (microsoft.public.vc.mfc)
  • Re: MIDI conjunction device
    ... I would agree on a one byte delay with UARTs, ... Ignoring bit-banged receivers and transmitter, ... If we queue each character for transmission as thery are received, ...
    (comp.arch.embedded)
  • Re: App does not become frontmost?? Delay in InitInstance
    ... Using my app on ... > Sure enuf, after a 35 second delay, I could see what they were seeing. ... your foreground window privileges. ... but any discussion of the "foreground window" issue should mention ...
    (microsoft.public.vc.mfc)

Quantcast