[Python-Dev] stack check on Unix: any suggestions? (original) (raw)
Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Wed, 30 Aug 2000 20:37:56 +0200
- Previous message: [Python-Dev] Threads & autoconf
- Next message: [Python-Dev] Release deadline looming (patches by Aug. 31)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
My SGI has getrlimit(RLIMITSTACK) which should do the trick
It tells you how much stack you've got; it does not tell you how much of that is actually in use.
Unix code will also have to differentiate between running on the main stack and a sub-thread stack, probably.
My patch computes (or, rather, estimates) a start-of-stack for each thread, and then saves that in the thread context.
And I haven't looked at the way PyOSCheckStack is implemented on Windows
It should work for multiple threads just fine. It tries to allocate 8k on the current stack, and then catches the error if any.
Regards, Martin
- Previous message: [Python-Dev] Threads & autoconf
- Next message: [Python-Dev] Release deadline looming (patches by Aug. 31)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]