Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Threads - influencing the number that may be created

Posted on 2004-10-22
3
Medium Priority
?
293 Views
Last Modified: 2010-04-15
I have a general question concerning the creation of threads.  Is there a way to tweak the compiler
settings to influence the number of threads that may be produced by a given program?  If so,
can someone explain to me how I may go about doing this.  I am programming in C using
Microsoft visual.net.  
0
Comment
Question by:jtrades
[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
3 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 12388956
it has nothing to do with tweking a compiler, you create threads in your code. if you do not create any extra threads then your program will have one thread, the primary thread.

to create extra threads look at _beginthread in VC++.

do a search on yahoo, there will be lots of threading examples
0
 

Author Comment

by:jtrades
ID: 12406013
I guess I need to rephrase my question.  I do know how threads are created and the functions
used for this process.  My question really has to do with what limits the number of threads
a program can create if that program were allowed to create an infinite supply.  Once this number
was known, could a person then tweak a compiler's settings (maybe shrinking/enlarging
a thread's stack size) to change this number.  If so, then can someone show me what I need to do
if I were using the Microsoft visual.net compiler.
0
 
LVL 2

Accepted Solution

by:
Sadrul earned 750 total points
ID: 12439701
> My question really has to do with what limits the number of threads
> a program can create if that program were allowed to create an infinite supply.

the operating system. so you'll need to tweak your OS settings. (there should be a setting as to how many children a process can have.)

-- Adil
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
Suggested Courses

604 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