Solved

limit number of threads per process

Posted on 2002-04-23
1
1,222 Views
Last Modified: 2010-07-27
Is there a way to limit the default (I think 2000) threads a process can open on windows Nt server (probably the same answer will be right on other windows OS's)

If not what is the best way to do so in the process code (e.g. an api to query the number of running threads before opening a new one)

0
Comment
Question by:finkelg
1 Comment
 
LVL 12

Accepted Solution

by:
pjknibbs earned 200 total points
ID: 6962771
AFAIK there's no way to do either using a simple API call. However, if this is your own program, why not just add a global counter variable, then increment it using InterlockedIncrement() at the start of your thread procedure and decrement it using InterlockedDecrement() at the end? That would then give you a count of how many threads your process was running which you could use any way you wanted.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally Windows/Microsoft Updates will fail to update. We have found a code that will delete all temporary files and re-register all dll's related to Windows/Microsoft Updates! This works 99% of the time to get the updates working again! The…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question