Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C Programming Language

How to change stack size?


Hi,

Is it possible to change the stack size of a DLL from within the source
code? When using threads you can specify the size of the stack you want
the thread to use, but since my application doesn't use threads I'm
looking for another solution.

Source code I haven't written but which I use creates a structure
containing 4 double arrays of almost 30k. I know this is big but it's
required and I cannot change anything about that.

At the moment I change the stack size via the project solution of the IDE
I'm using and it works for me, but when I ship the .dll and .lib file to
someone else he too has to change the stack size in the project solution
of his IDE. This is something I would like to avoid since it's possible
the required stack size might change in the future and I don't want to
bother the users of the DLL with that.

Regards,
Jensen

In article <k_OdnXJhtP6QKPjbRVny@giganews.com>,
Jensen Somers  <use@jsomers.be> wrote:

>Is it possible to change the stack size of a DLL from within the source
>code?

What's a stack? What's a DLL?

>When using threads you can specify the size of the stack you want
>the thread to use, but since my application doesn't use threads I'm
>looking for another solution.

What are threads?

>Source code I haven't written but which I use creates a structure
>containing 4 double arrays of almost 30k. I know this is big but it's
>required and I cannot change anything about that.

>At the moment I change the stack size via the project solution of the IDE
>I'm using and it works for me, but when I ship the .dll and .lib file to

What's an IDE? What's a .dll file? What's a .lib file? What's a
"project solution of the IDE"?

>someone else he too has to change the stack size in the project solution
>of his IDE. This is something I would like to avoid since it's possible
>the required stack size might change in the future and I don't want to
>bother the users of the DLL with that.

Your question is sounding suspiciously system-specific; I would suggest
that you ask in a newsgroup pertaining to whatever operating system
you are using. C itself does not use any of the terms I pointed out
(no, not even "stack" -- there are C implementations which do
not use stacks), but those terms are perhaps used in some specific
implementations.
--
  "law -- it's a commodity"
                         -- Andrew Ryan (The Globe and Mail, 2005/11/26)

On Tue, 05 Jun 2007 19:22:14 +0000, Walter Roberson wrote:

> Your question is sounding suspiciously system-specific; I would suggest
> that you ask in a newsgroup pertaining to whatever operating system you
> are using. C itself does not use any of the terms I pointed out (no, not
> even "stack" -- there are C implementations which do not use stacks),
> but those terms are perhaps used in some specific implementations.

I know, at the moment I focus on MS Windows since the Linux
implementation of the library uses threads and doesn't have this problem
anymore.
If I ask this in an OS specific newsgroup people point me to the C
newsgroups and at the end I don't know where to ask anymore.

Regards,
Jensen

"Jensen Somers" <use@jsomers.be> schrieb im Newsbeitrag
news:G-mdnfZpI5BlJfjbnZ2dnUVZ8szinZ2d@giganews.com...
> On Tue, 05 Jun 2007 19:22:14 +0000, Walter Roberson wrote:

>> Your question is sounding suspiciously system-specific; I would suggest
>> that you ask in a newsgroup pertaining to whatever operating system you
>> are using. C itself does not use any of the terms I pointed out (no, not
>> even "stack" -- there are C implementations which do not use stacks),
>> but those terms are perhaps used in some specific implementations.

> I know, at the moment I focus on MS Windows since the Linux
> implementation of the library uses threads and doesn't have this problem
> anymore.
> If I ask this in an OS specific newsgroup people point me to the C
> newsgroups and at the end I don't know where to ask anymore.

If someone points you to comp.lang.c for this question (s)he simply wrong.

Bye, Jojo

In article <G-mdnfZpI5BlJfjbnZ2dnUVZ8szin@giganews.com>,
Jensen Somers  <use@jsomers.be> wrote:
[earlier]

>>>Is it possible to change the stack size of a DLL from within the source
>>>code? When using threads you can specify the size of the stack you want
>>>the thread to use, but since my application doesn't use threads I'm
>>>looking for another solution.
>On Tue, 05 Jun 2007 19:22:14 +0000, Walter Roberson wrote:
>> Your question is sounding suspiciously system-specific; I would suggest
>> that you ask in a newsgroup pertaining to whatever operating system you
>> are using.
>I know, at the moment I focus on MS Windows since the Linux
>implementation of the library uses threads and doesn't have this problem
>anymore.
>If I ask this in an OS specific newsgroup people point me to the C
>newsgroups and at the end I don't know where to ask anymore.

Well, for what it's worth, my off-topic answer to your question is NO.

http://support.microsoft.com/kb/932909

  The maximum stack size of a thread is not determined by an
  individual ISAPI, DLL, or ASP component that is running inside
  the process. The maximum stack size of a thread is configured by
  the executable file of the process.

http://msdn2.microsoft.com/en-us/library/aa461430.aspx

(on use of a /F compiler option to set the program stack size)

  Other ways to set the stack size

    Using the /STACK linker option.
    Using EDITBIN on the .exe file.

Notice the lack of listing of any API option.

But you should consider my "NO" answer to be low quality and unproven,
as I never develop in Windows, and Microsoft's site contradicts itself
regularily (or to be more charitable, that I might have only found
older documentation and possibly XP or Vista has a way to do it.)

My answer was derived entirely from a bit of googling of
site:microsoft.com with keywords  set stack size

If you rely on my answer for a question of this importance to you,
then you would be making a mistake. You need something system specific
to MS Windows, and the only reason I keep a Windows system around
is to drive my printer.
--
   I was very young in those days, but I was also rather dim.
   -- Christopher Priest

Jensen Somers wrote:

> Is it possible to change the stack size of a DLL from within the
> source code? When using threads you can specify the size of the
> stack you want the thread to use, but since my application doesn't
> use threads I'm looking for another solution.

The C standard doesn't mention DLL nor a stack.  Thus you are
off-topic.  Try a newsgroup that deals with your system.

--
 <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
 <http://www.securityfocus.com/columnists/423>
 <http://www.aaxnet.com/editor/edit043.html>
 <http://kadaitcha.cx/vista/dogsbreakfast/index.html>
                        cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

In article <4665EB95.2AD70@yahoo.com>,

CBFalconer  <cbfalco@maineline.net> wrote:
>Jensen Somers wrote:

>> Is it possible to change the stack size of a DLL from within the
>> source code? When using threads you can specify the size of the
>> stack you want the thread to use, but since my application doesn't
>> use threads I'm looking for another solution.

>The C standard doesn't mention DLL nor a stack.  Thus you are
>off-topic.  Try a newsgroup that deals with your system.

I assume the word 'newsgroup' doesn't appear in the C standard either.
Thus, you are off-topic.

I would imagine that it would be easy enough to build a concordance of
the words found in the C standard, and then to write a newsgroup scanner
that would check each post for compliance with said concordance.  The
scanner would then, of course, post an appropriate response to the
newsgroup, either pointing out the off-topic words (thereby rendering
CBFalconer redundant) or, in the extremely unlikely event that all words
passed, would say something like "Good Job!!  You are officially on-topic!"

I would not be surprised to find that one or more of the regulars have
already done this.  If not, get on it!

The stack size is allocated at startup. It is by default 1MB so it is
difficult to understand what is your problem... 30K should not make
a big difference.

I am speaking about 32 bit windows of course. Are you using 16 bit
systems?

Once more, this is off-topic, and you should have simply referred
him to a suitable news-group.  I'm in a bad mood today.

--
 <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
 <http://www.securityfocus.com/columnists/423>
 <http://www.aaxnet.com/editor/edit043.html>
 <http://kadaitcha.cx/vista/dogsbreakfast/index.html>
                        cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

In article <4666CBB2.13BF8@yahoo.com>,

Geez.  Words just fail me.
You see, there are these things call lives.  You can get one (yes, even
you).  There is also this thing called sunshine.  It is out there,
waiting for you to go out and enjoy it.
Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc