[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] Re: gazonk-name
From: |
Gabriel Dos Reis |
Subject: |
[Axiom-developer] Re: gazonk-name |
Date: |
Sun, 10 Dec 2006 17:56:22 -0600 (CST) |
On Mon, 11 Dec 2006, root wrote:
| I didn't bother to document "the why" :-) . The AKCL compiler
| wrote out the lisp code into a file called
| /tmp/gazonk which was supposed to be a temporary file and
| was erased when the compiler completed.
Thanks for the "why". That prompted me to look into GCL's
source code.
| Due to the speed of the machines it was often the case that I
| would have an Axiom build running (nearly continuously since
| it took so long) and I'd want to also continue to work. If I
| did a compile-file there would be a gazonk name collision
| since these were two independent lisp images. Thus compiling
| a file usually caused the Axiom build to fail. This fixes the
| problem by searching for an unused name.
|
| This might still be an issue for parallel builds. I'm not sure
| what GCL does. Although I suspect this bit Bill Schelter and
| he likely fixed it in AKCL/GCL.
It is fixed in GCL in pseudo "randomized way" -- GCL could use mkstemp
(if available on the system) as opposed to getpid().
(import 'si::*tmp-dir* 'compiler)
(defun gazonk-name ()
(dotimes (i 1000)
(let ((tem (merge-pathnames
(format nil "~agazonk_~d_~d.lsp" (if (boundp '*tmp-dir*)
*tmp-dir* "") (abs (si::getpid)) i))))
(unless (probe-file tem)
(return-from gazonk-name (pathname tem)))))
(error "1000 gazonk names used already!"))
It is now OK to remove Axiom's work-around.
-- Gaby