Message253742
On OSX 10.4 or later the following functions are available:
size_t pthread_get_stacksize_np(pthread_t);
void* pthread_get_stackaddr_np(pthread_t);
These functions could be used to implement PyOS_CheckStack on OSX. The advantage of this would be that it would get less likely that recursion causes hard crashes when the recursion limit is not optimally tuned to the stack size on OSX. (Note that OSX has a fixed size stack for the main thread as well, AFAIK unlike linux).
The disadvantage of implementing this is that a naive implementation might have a negative performance impact. It should be possible to avoid this by caching the return values of these functions in the thread state.
Another disadvantage according to a quick search on Google: ``pthread_get_stacksize_np`` appears to be buggy on some OSX versions, which requires workarounds to get the right behavior. |
|
Date |
User |
Action |
Args |
2015-10-30 16:12:03 | ronaldoussoren | set | recipients:
+ ronaldoussoren, ned.deily |
2015-10-30 16:12:03 | ronaldoussoren | set | messageid: <1446221523.82.0.826583812688.issue25518@psf.upfronthosting.co.za> |
2015-10-30 16:12:03 | ronaldoussoren | link | issue25518 messages |
2015-10-30 16:12:03 | ronaldoussoren | create | |
|