Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!198.186.194.247.MISMATCH!news-out.readnews.com!transit3.readnews.com!panix!not-for-mail From: jgk@panix.com (Joe keane) Newsgroups: comp.lang.c++ Subject: Re: Converting recursive algorithm to an iterative version Date: Sun, 11 Dec 2011 20:36:54 +0000 (UTC) Organization: Public Access Networks Corp. Lines: 22 Message-ID: References: <618ba19e-c74f-4fcd-a16a-a6542270c73d@j10g2000vbe.googlegroups.com> <6a34e87e-5a2c-4c1a-ad6e-307b4facc507@c13g2000vbh.googlegroups.com> <3a4e0e77-735c-4154-b605-bcf2bd637aa1@q11g2000vbq.googlegroups.com> NNTP-Posting-Host: panix5.panix.com X-Trace: reader1.panix.com 1323635814 8967 166.84.1.5 (11 Dec 2011 20:36:54 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Sun, 11 Dec 2011 20:36:54 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:12360 In article , Paavo Helde wrote: >Increasing the stack size should be relatively harmless unless the app has >many threads. That's what gets you... Stack on multi-thread apps is demanding. Even if some memory is needed for a short time, (heap is what the threads need at the same time, stack is what all the threads need some of the time) the heap allocation may be -faster- (because it uses memory efficiently). Also running out of stack is ungraceful... If you call malloc and it returns NULL (oh wait this C++ you know what mean) you can try to restore some semblance of order. Out of stack, blam! Your files, shared memory?? I echo some other posters that we don't know the context of program. Some app you only run yourself? Quasi-real-time where some people die if it fails?