?
Solved

limit number of threads per process

Posted on 2002-04-23
1
Medium Priority
?
1,232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
pjknibbs earned 600 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
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.

770 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