Solved

limit number of threads per process

Posted on 2002-04-23
1
1,210 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Just about everyone has an old PC laying around.  Ask anyone in the IT industry, whether they are a professional or play in it as a hobby.  From outdated Desktops to cheap "throwaway" laptops, they are all around and not as hard to "fix up" as you m…
Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now