堆栈大小 [英] Stack Size

查看:75
本文介绍了堆栈大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档指出线程默认堆栈大小。是1MB。

工作默认暗示它可以改变。


是否可以在.NET中更改StackSize?如果是这样的话?


是否可以确定当前堆栈中使用的内存量?


任何帮助都将不胜感激。


Ben

The documentation indicates that the threads "default stack size" is 1MB.
The work "default" implies that it can be changed.

Is it possible to change the StackSize in .NET? If so how?

Is it possible to determine the amount of memory used in the current stack?

Any assistance would be appreciated.

Ben

推荐答案

Ben,


不幸的是没有。您正在阅读的文档是用于在系统中创建新线程的

,由Thread类处理。

CreateThread API函数允许您设置堆栈大小,你可以从.NET调用它.b $ b。但是,我不知道这是不是一个好主意,因为我不确定运行时将如何看待该线程。


希望这个帮助。

-

- Nicholas Paldino [.NET / C#MVP]

- nick(dot)paldino = at = exisconsulting< dot> ; com


" Ben R. Bolton" < XB ******* @ hotmail.com>在消息中写道

news:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
Ben,

Unfortunately no. The documentation you were reading was for the
creation of new threads in the system, which is handled by the Thread class.
The CreateThread API function allows you to set the stack size and you can
call it from .NET. However, I don''t know if that is a good idea, since I am
not sure how the runtime will perceive that thread.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Ben R. Bolton" <xb*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
文档表示线程默认堆栈大小。是1MB。
工作默认是暗示它可以改变。

是否可以在.NET中更改StackSize?如果是这样的话?

是否有可能确定当前
堆栈中使用的内存量?
任何帮助都将受到赞赏。


The documentation indicates that the threads "default stack size" is 1MB.
The work "default" implies that it can be changed.

Is it possible to change the StackSize in .NET? If so how?

Is it possible to determine the amount of memory used in the current stack?
Any assistance would be appreciated.

Ben



谢谢Nicholas,


我曾经认为它不能改变因为我可以找不到关于

如何更改它的参考。但是无论如何都想问。


是否有可能确定目前1MB内存的使用量是多少?(在堆栈中)?


Ben


" Nicholas Paldino [.NET / C#MVP]" < NI ************** @ exisconsulting.com>在消息新闻中写了

:eO ************** @ TK2MSFTNGP09.phx.gbl ...
Thanks Nicholas,

I hadassumed it couldn''t be changed since I could find no reference as to
how to change it. But wanted to ask anyway.

Is it possible to determine how much of the 1MB of memory is currently being
used (is on the stack)?

Ben

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote
in message news:eO**************@TK2MSFTNGP09.phx.gbl...
Ben,
不幸的是没有。您正在阅读的文档用于在系统中创建新线程,该线程由Thread
类处理。 CreateThread API函数允许您设置堆栈大小,您可以从.NET调用它。但是,我不知道这是不是一个好主意,因为我
不确定运行时将如何看待该线程。

希望这会有所帮助。

-
- Nicholas Paldino [.NET / C#MVP]
- nick(dot)paldino = at = exisconsulting< dot> com

Ben R. Bolton ; < XB ******* @ hotmail.com>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
Ben,

Unfortunately no. The documentation you were reading was for the
creation of new threads in the system, which is handled by the Thread class. The CreateThread API function allows you to set the stack size and you can
call it from .NET. However, I don''t know if that is a good idea, since I am not sure how the runtime will perceive that thread.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Ben R. Bolton" <xb*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
文档表明线程默认堆栈大小是
1MB。作品默认是指暗示它可以改变。

是否可以在.NET中更改StackSize?如果是这样的话?

是否可以确定当前
The documentation indicates that the threads "default stack size" is 1MB. The work "default" implies that it can be changed.

Is it possible to change the StackSize in .NET? If so how?

Is it possible to determine the amount of memory used in the current


堆栈中使用的内存量?


stack?


任何帮助都会感谢。



Any assistance would be appreciated.

Ben






嗨Ben,


似乎没有简单的方法来获得当前使用的堆栈大小

线程。

可能你可以参考NtQueryInformationThread DDK函数获取指定线程的信息



因为它是DDK函数,所以你必须先安装DDK。 br />

希望这会有所帮助,


祝你好运,

Jeffrey Tan

Microsoft Online合作伙伴支持

安全! - www.microsoft.com/security

此帖子按原样提供没有保证,也没有赋予任何权利。


--------------------

|答复:Ben R. Bolton < xb ******* @ hotmail.com>

|来自:Ben R. Bolton < xb ******* @ hotmail.com>

|参考文献:< #o ************** @ TK2MSFTNGP09.phx.gbl>

< eO ************ **@TK2MSFTNGP09.phx.gbl>

|主题:回复:堆栈大小

|日期:2003年10月7日星期二12:48:13 -0700

|行数:51

| X-Priority:3

| X-MSMail-Priority:正常

| X-Newsreader:Microsoft Outlook Express 6.00.2800.1158

| X-MimeOLE:由Microsoft MimeOLE V6.00.2800.1165制作

|消息ID:< #f ************** @ tk2msftngp13.phx.gbl>

|新闻组:microsoft.public.dotnet.languages.csharp

| NNTP-Posting-Host:12-236-76-193.client.attbi.com 12.236.76.193

|路径:cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl

|外翻:cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:189651

| X-Tomcat-NG:microsoft.public.dotnet.languages.csharp

|

|谢谢Nicholas,

|

|因为我找不到关于

|的参考,所以我觉得它无法改变如何改变它。但无论如何都想问。

|

|是否有可能确定目前1MB内存中有多少



|二手(在堆栈上)?

|

|本

|

|

|

| Nicholas Paldino [.NET / C#MVP]" < ni ************** @ exisconsulting.com>

写道

|在留言新闻中:eO ************** @ TK2MSFTNGP09.phx.gbl ...

| >本,

| >

| >很不幸的是,不行。你正在阅读的文件是

| >在系统中创建新线程,由线程处理

|上课。

| > CreateThread API函数允许您设置堆栈大小,您可以

可以

| >从.NET调用它。但是,我不知道这是不是一个好主意,因为



|我是

| >不确定运行时将如何感知该线程。

| >

| >希望这会有所帮助。

| >

| >

| > -

| > - Nicholas Paldino [.NET / C#MVP]

| > - nick(dot)paldino = at = exisconsulting< dot> com

| >

| > Ben R. Bolton < XB ******* @ hotmail.com>在消息中写道

| >新闻:%2 **************** @ TK2MSFTNGP09.phx.gbl ...

| > >该文档指出线程默认堆栈大小。是

| 1MB。

| > >作品默认是指暗示它可以改变。

| > >

| > >是否可以在.NET中更改StackSize?如果是这样的话?

| > >

| > >是否可以确定当前

|中使用的内存量>堆栈?

| > >

| > >任何帮助将不胜感激。

| > >

| > >本

| > >

| > >

| >

| >

|

|

|


Hi Ben,

It seems that there is no easy way to get the current used stack size of
the thread.
May be you can refer to the NtQueryInformationThread DDK function to get
the information of specified thread.
Because it is a DDK function, you must install the DDK first.

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Reply-To: "Ben R. Bolton" <xb*******@hotmail.com>
| From: "Ben R. Bolton" <xb*******@hotmail.com>
| References: <#o**************@TK2MSFTNGP09.phx.gbl>
<eO**************@TK2MSFTNGP09.phx.gbl>
| Subject: Re: Stack Size
| Date: Tue, 7 Oct 2003 12:48:13 -0700
| Lines: 51
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#f**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 12-236-76-193.client.attbi.com 12.236.76.193
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:189651
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Thanks Nicholas,
|
| I hadassumed it couldn''t be changed since I could find no reference as to
| how to change it. But wanted to ask anyway.
|
| Is it possible to determine how much of the 1MB of memory is currently
being
| used (is on the stack)?
|
| Ben
|
|
|
| "Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com>
wrote
| in message news:eO**************@TK2MSFTNGP09.phx.gbl...
| > Ben,
| >
| > Unfortunately no. The documentation you were reading was for the
| > creation of new threads in the system, which is handled by the Thread
| class.
| > The CreateThread API function allows you to set the stack size and you
can
| > call it from .NET. However, I don''t know if that is a good idea, since
I
| am
| > not sure how the runtime will perceive that thread.
| >
| > Hope this helps.
| >
| >
| > --
| > - Nicholas Paldino [.NET/C# MVP]
| > - nick(dot)paldino=at=exisconsulting<dot>com
| >
| > "Ben R. Bolton" <xb*******@hotmail.com> wrote in message
| > news:%2****************@TK2MSFTNGP09.phx.gbl...
| > > The documentation indicates that the threads "default stack size" is
| 1MB.
| > > The work "default" implies that it can be changed.
| > >
| > > Is it possible to change the StackSize in .NET? If so how?
| > >
| > > Is it possible to determine the amount of memory used in the current
| > stack?
| > >
| > > Any assistance would be appreciated.
| > >
| > > Ben
| > >
| > >
| >
| >
|
|
|


这篇关于堆栈大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆