From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,a7d8ee4db1b2666 X-Google-Attributes: gidfee84,public X-Google-Thread: f678f,a7d8ee4db1b2666 X-Google-Attributes: gidf678f,public From: c632692@csdeca.cs.missouri.edu (Vepa V Sirish) Subject: Re: Increasing pthread stack in an RPC-server. Date: 1995/06/06 Message-ID: <3r1tkm$ond@news.missouri.edu>#1/1 X-Deja-AN: 103909337 references: followup-to: comp.unix.osf.osf1,comp.unix.osf.misc organization: University of Missouri - Columbia newsgroups: comp.unix.osf.osf1,comp.unix.osf.misc Gopi K. Attaluri (gkattalu@neumann.uwaterloo.ca) wrote: : hi, : I am writing RPC-based server application using Encina and DCE. I : run into problems such as corrupted stacks and corrupted pthread internal : data structures. I suspect that they are due to stack overflow of server : threads. : The documentation for pthreads says that stack-size must be specified : at thread creation time. But, the server threads are created by the RPC-runtime : not the application itself. Is there any way I can "instruct" the RPC run-time : to allocate a larger stack to each thread? : Thanks, : -gopi krishna. : --- : Gopi K. Attaluri : Department of Computer Science : University of Waterloo : gkattalu@neumann.uwaterloo.ca use rpc_mgmt_set_server_stack_size #define STACKSIZE (64*1024) { int st ; unsigned int thread_stk_size = STACKSIZE ; rpc_mgmt_set_server_stack_size(thread_stk_size,&st) ; if (st != rpc_s_ok) { handle the error here } thread_status = pthread_attr_getstacksize(thread_atribs) ; CHECK(thread_status,"attr_getstacksize failed") ; thread_status = pthread_attr_setstacksize(&thread_atribs,thread_stk_size); CHECK(thread_status,"setstacksize failed"); } Ideally one would check if the current stack size is less than what is to be set and then proceed to increase the stack size. hope this helps -sirish -- ******************************************************************************* 316 A&S Bldg, U of Missouri, Columbia MO 65211 E-mail : sirish@csdeca.cs.missouri.edu, c632692@mizzou1.missouri.edu *******************************************************************************