I am using ‘tfork()’ under QNX 4.25 (yes I am planning on porting to
RTP to get real threads ). The example in the doc shows calling ‘tfork’ with a
stack size of 2000 bytes. I copied this but crashed horribly when
my ‘thread’ executed ‘gethostbyname()’. I increased the stack size to
20000 bytes and all worked fine.
My question is how does one know a good size to make the stack? In this
case 2000 was too small. How can I tell the stack size of a QNX
process to get some ideas of what’s normal?
I am using ‘tfork()’ under QNX 4.25 (yes I am planning on porting to
RTP to get real threads > > ). The example in the doc shows calling
‘tfork’ with a
stack size of 2000 bytes. I copied this but crashed horribly when
my ‘thread’ executed ‘gethostbyname()’. I increased the stack size to
20000 bytes and all worked fine.
TCP/IP is NOT thread safe. nor is Photon for that matter
My question is how does one know a good size to make the stack? In this
case 2000 was too small. How can I tell the stack size of a QNX
process to get some ideas of what’s normal?
Allocate the stack yourself, fill it with a know pattern,
when the thread is terminated scan the stack memory where
the pattern stops that will tell ya the max stack size use
by that program at the time
I am using ‘tfork()’ under QNX 4.25 (yes I am planning on porting to
RTP to get real threads > > ). The example in the doc shows calling
‘tfork’ with a
stack size of 2000 bytes. I copied this but crashed horribly when
my ‘thread’ executed ‘gethostbyname()’. I increased the stack size to
20000 bytes and all worked fine.
My question is how does one know a good size to make the stack? In this
case 2000 was too small. How can I tell the stack size of a QNX
process to get some ideas of what’s normal?
What is the difference between tfork and _beginthread?
Previously, Mario Charest wrote in qdn.public.qnx4:
Check out _beginthread instead of tfork.
“art” <> avhays@nih.gov> > wrote in message
news:> Voyager.001207090630.1916959A@lsr-tstc.lsrnet.nei.nih.gov> …
I am using ‘tfork()’ under QNX 4.25 (yes I am planning on porting to
RTP to get real threads > > ). The example in the doc shows calling
‘tfork’ with a
stack size of 2000 bytes. I copied this but crashed horribly when
my ‘thread’ executed ‘gethostbyname()’. I increased the stack size to
20000 bytes and all worked fine.
TCP/IP is NOT thread safe. nor is Photon for that matter
My question is how does one know a good size to make the stack? In
this
case 2000 was too small. How can I tell the stack size of a QNX
process to get some ideas of what’s normal?
Allocate the stack yourself, fill it with a know pattern,
when the thread is terminated scan the stack memory where
the pattern stops that will tell ya the max stack size use
by that program at the time >
What is the difference between tfork and _beginthread?
Previously, Mario Charest wrote in qdn.public.qnx4:
Check out _beginthread instead of tfork.
“art” <> avhays@nih.gov> > wrote in message
news:> Voyager.001207090630.1916959A@lsr-tstc.lsrnet.nei.nih.gov> …
I am using ‘tfork()’ under QNX 4.25 (yes I am planning on porting to
RTP to get real threads > > ). The example in the doc shows calling
‘tfork’ with a
stack size of 2000 bytes. I copied this but crashed horribly when
my ‘thread’ executed ‘gethostbyname()’. I increased the stack size to
20000 bytes and all worked fine.
TCP/IP is NOT thread safe. nor is Photon for that matter
My question is how does one know a good size to make the stack? In this
case 2000 was too small. How can I tell the stack size of a QNX
process to get some ideas of what’s normal?
Allocate the stack yourself, fill it with a know pattern,
when the thread is terminated scan the stack memory where
the pattern stops that will tell ya the max stack size use
by that program at the time >