🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #2697

Global Stack Overflow

#2697
From: Sundar Iyengar
Date: Sat, 27 Jun 1987 04:40
35 lines
2172 bytes
Recently someone asked how to circumvent the global stack
overflow problem.  A simple solution is to increase its size
using command line switches.  For example, the following command,
	cprolog -g 1000
allocates 1000K for the global stack.  However, this may cause
your program to run slower.  CProlog allocates all the space
it needs first before starting.  This means, you must have
sufficient disk space to swap in and swap out pages.  On Apollo
nodes on which I run C-Prolog, this causes great slow down in 
the program run time performance.

I have a related question to Prolog Experts.  According
to David Warren's thesis, global stack is an area reserved
for global variables.  The lifetime of these variables is
supposed end on backtracking past the procedure head in
which they appear.  Theoretically the space is supposed
to be recovered.  For some reason, this is not happening
in our C-Prolog.  I have experimented with using cuts to
remove all unnecessary choice points for almost all procedures
in the program, but still I can't seem to stop the global
stack from growing for ever (right now, I am getting by
with 4M sized global stack, which seems to be bit too much).
I am not sure if I am doing anything wrong.  Could some one
please help?  We are running C-Prolog 1.5 with mods from
Caltech.

Thanks.

Sundar R. Iyengar		

ARPA, CSNET: sundar@cwru.edu   <---------------------- Note new address
UUCP:        {decvax,cbatt,cbosgd,sun}!cwruecmp!sundar

USNAIL: 531, Crawford, Case Western Reserve University
        Cleveland, OH 44106
Technical Details
Message-ID: <2163@cwruecmp.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!sri-unix!sri-spam!ames!amdcad!amd!intelca!oliveb!pyramid!uccba!hal!cwruecmp!sundar

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!sri-unix!sri-spam!ames!amdcad!amd!intelca!oliveb!pyramid!uccba!hal!cwruecmp!sundar
From: sundar@cwruecmp.UUCP (Sundar Iyengar)
Newsgroups: comp.lang.prolog
Subject: Global Stack Overflow
Message-ID: <2163@cwruecmp.UUCP>
Date: Sat, 27-Jun-87 00:40:10 EDT
Article-I.D.: cwruecmp.2163
Posted: Sat Jun 27 00:40:10 1987
Date-Received: Sun, 28-Jun-87 01:20:57 EDT
Reply-To: sundar@cwruecmp.UUCP (Sundar Iyengar)
Organization: CWRU Dept. of Computer Engineering, Cleveland, Ohio
Lines: 35