Hi,
I wanna know the currently running thread's stack size ??
Thankz in advance !!!
Hi,
I wanna know the currently running thread's stack size ??
Thankz in advance !!!
Well that's a fairly meaningless question without some idea of what OS / Compiler / thread library you're using.
If that library doesn't tell you, then it's a tough ask.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
man getrlimit
I don't know how on windows, but I imagine I can find the answer on google faster than you can respond to this.
Damn, I failed you, you may now all mock me for my cockyness.
Last edited by valis; 07-25-2006 at 04:07 PM.
hi,
I m really sorry,Sorry for inconvinience....
Compiler is VC++6.0 ,OS using is Windows2000server.
Actually I have been doin a program in sockets using Win32 API.
Here I m running several threads so Is there any possibility to know the size of the currently running thread's memory size how much it's using.
Thankz.
HI,
do u mean in google search?? yaeh, i tried but no result?? If u don't mind could u please send me the answer for this?
Thankz,
m.sudhakar
Well to know how much you've got in total, read this
http://msdn.microsoft.com/library/de...eatethread.asp
This might help - you gotta spend more time reading MSDN, or at least skimming it so you know roughly what sort of things are available even if you don't remember the details.
http://msdn.microsoft.com/library/de...eadcontext.asp
There is also this hack.
Code:char *stackBase; ptrdiff_t stackSize ( void ) { char dummy; // on the stack, at end of current call chain return stackBase - &dummy; } DWORD WINAPI ThreadProc ( LPVOID lpParameter ) { char dummy; // on the stack at the start stackBase = &dummy; // rest of thread code goes here, calling whatever functions it needs. }
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
hi,
SALEM !... Thanks a lot.