Path: utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice!sun-spots-request From: neal@druhi.att.com Newsgroups: comp.sys.sun Subject: Tasking and stack space usage by printf on Sun 3 Keywords: SunOS Message-ID: <282@brchh104.bnr.ca> Date: 16 Nov 90 12:05:00 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 14 Approved: Sun-Spots@rice.edu X-Original-Date: 25 Oct 90 22:03:40 GMT X-Sun-Spots-Digest: Volume 9, Issue 367, message 2 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu Warning - the Sun 3 implementation of printf (and fprintf, sprintf) uses a large amount of stack space - over 2000 bytes in normal usage. When you use the %f format for floating point, the usage goes up to over 20000 bytes! This may not matter a lot in most situations, but when you are managing multiple tasks, e.g. using the C++ task library, you need to allocate lots of space for the stack frames. (The default is 3000 bytes.) This is true for at least the 4.0 release of SunOS on a Sun 3. Does anyone know if this is true in 4.1, or on the SPARC implementation? Does anyone have an alternative implementation of fconvert(), etc? -Neal McBurnett // AT&T Bell Labs, Denver // neal@druhi.ATT.COM, att!druhi!neal