Solved

limit number of threads per process

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

Independent Software Vendors: 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

Suggested Solutions

Hello I read in a discussion about a person who configured a very simple mirror RAID with two hard drives; the system and data were on the same partition. He asked how to repair the system as it was not booting up anymore. In his case running …
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
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.

730 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