digitalmars.D - pthread_create oddity
- Andrei Alexandrescu (7/7) Aug 07 2015 I ran into an oddity of pthread_create, see
- Steven Schveighoffer (4/9) Aug 07 2015 What is the stack size using pthread_getstacksize before the setting of ...
- Daniel Kozak via Digitalmars-d (4/18) Aug 07 2015 V Fri, 07 Aug 2015 14:20:59 -0400
- Andrei Alexandrescu (6/14) Aug 08 2015 pthread_getstacksize indicates 8,388,608 bytes. It doesn't seem
- Steven Schveighoffer (8/13) Aug 10 2015 Does the failure always happen with any thread create? Or only after you...
I ran into an oddity of pthread_create, see https://github.com/D-Programming-Language/druntime/pull/1340. It appears that if stack size is not explicitly set, the 32-bit version of pthread_create fails. That's happening at least on Ubuntu64 under VMWare hosted on Linux. Unrelated: what's the deal with the build fail by CyberShadow/DAutoTest? Andrei
Aug 07 2015
On 8/7/15 1:36 PM, Andrei Alexandrescu wrote:I ran into an oddity of pthread_create, see https://github.com/D-Programming-Language/druntime/pull/1340. It appears that if stack size is not explicitly set, the 32-bit version of pthread_create fails. That's happening at least on Ubuntu64 under VMWare hosted on Linux.What is the stack size using pthread_getstacksize before the setting of it? I would think with pthread_attr_init, it should be a reasonable default. -Steve
Aug 07 2015
V Fri, 07 Aug 2015 14:20:59 -0400 Steven Schveighoffer via Digitalmars-d <digitalmars-d puremagic.com> napsáno:On 8/7/15 1:36 PM, Andrei Alexandrescu wrote:Yes it is a default, which is zero, so problem is somewhere elseI ran into an oddity of pthread_create, see https://github.com/D-Programming-Language/druntime/pull/1340. It appears that if stack size is not explicitly set, the 32-bit version of pthread_create fails. That's happening at least on Ubuntu64 under VMWare hosted on Linux.What is the stack size using pthread_getstacksize before the setting of it? I would think with pthread_attr_init, it should be a reasonable default.-Steve
Aug 07 2015
On 8/7/15 2:20 PM, Steven Schveighoffer wrote:On 8/7/15 1:36 PM, Andrei Alexandrescu wrote:pthread_getstacksize indicates 8,388,608 bytes. It doesn't seem excessive, but the 32-bit build does find that too big. If I try to set stack size to that value with pthread_setstacksize, indeed the thread fails. So it's not that you need to call pthread_setstacksize, you need to call it with a smaller value. -- AndreiI ran into an oddity of pthread_create, see https://github.com/D-Programming-Language/druntime/pull/1340. It appears that if stack size is not explicitly set, the 32-bit version of pthread_create fails. That's happening at least on Ubuntu64 under VMWare hosted on Linux.What is the stack size using pthread_getstacksize before the setting of it? I would think with pthread_attr_init, it should be a reasonable default.
Aug 08 2015
On 8/8/15 8:40 AM, Andrei Alexandrescu wrote:pthread_getstacksize indicates 8,388,608 bytes. It doesn't seem excessive, but the 32-bit build does find that too big. If I try to set stack size to that value with pthread_setstacksize, indeed the thread fails. So it's not that you need to call pthread_setstacksize, you need to call it with a smaller value. -- AndreiDoes the failure always happen with any thread create? Or only after you have created X threads? 8MB doesn't seem like that much, but if you created 100 threads at 8MB a piece... What about an equivalent C program? something doesn't seem right when the default value isn't working... -Steve
Aug 10 2015