Solved

Threads - influencing the number that may be created

Posted on 2004-10-22
246 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
Question by:jtrades
    3 Comments
     
    LVL 10

    Expert Comment

    by:makerp
    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
    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:
    > 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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
    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 recursion in the C programming language.
    The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

    846 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

    5 Experts available now in Live!

    Get 1:1 Help Now