1、在 Linux 中,栈大小在线程属性对象中设置,也就是说,将类型为pthread_attr_t的参数threadAttr传递给函数 pthread_create()。

3、然后使用pthread_attr_setstacksize()函数设置线程栈空间大小,单位为字节。

5、把线程栈空间设置为2M后进行了测试。

1、在 Linux 中,栈大小在线程属性对象中设置,也就是说,将类型为pthread_attr_t的参数threadAttr传递给函数 pthread_create()。
3、然后使用pthread_attr_setstacksize()函数设置线程栈空间大小,单位为字节。
5、把线程栈空间设置为2M后进行了测试。