[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: gazonk file clashes

From: Camm Maguire
Subject: [Gcl-devel] Re: gazonk file clashes
Date: 05 Sep 2008 13:13:37 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2


Are you using the latest 2.6.8pre?  If so, the gazonk names should be
as follows:

(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!"))

i.e. /tmp/gazonk_14807_0, etc.

I'm hoping make -j starts gcl images with new pid's, which should
remove the conflict.  If not, one could (si::mkdir ..) and set

2.7.0 has the following nifty mechanism:

(defmacro with-temp-file ((s pn) (tmp ext) &rest body) 
  `(let* ((,s (temp-stream ,tmp ,ext)) 
          (,pn (stream-object1 ,s))) 
     (unwind-protect (progn ,@body) (progn (close ,s) (delete-file

where temp-stream uses the underlying UNIX unique filehandle
mechanism.  Perhaps gazonk should use this.

Please let me know if problems persist.

Matt Kaufmann <address@hidden> writes:

> Hi, Camm --
> Short version of this email: Maybe the gazonk* mechanism could be
> improved by some sort of locking, to allow parallelism.  In the
> meantime, is there a user-level sort of lock I could use?
> Longer version:
> I wonder if you have any thoughts on how I might get around the
> following problem.
> Imagine that there are several Lisp files being loaded in the same
> directory at the same time, by a parallel make.  Imagine that they
> have forms (compile ...).  If two such forms are evaluated at
> different but overlapping times, then one will generate gazonk0* files
> while the other will generate gazonk1* files, which is fine.  But I
> seem to have found cases when gazonk0* files are generated for two
> different forms, I suppose because compilation starts at just about
> the same time.
> I've seen this in (approximately) ACL2 Version 3.4:
> cd books/parallel/, and type "make -j 8" say on a multicore machine
> after building ACL2 on GCL 2.6.7.  If you try this a few times and
> don't see it happening, I can send you a tarball of the exact files I
> have.
> (Aside: The ACL2 .lisp files in question don't have (compile ...)
> forms in them.  Instead, they have (set-compile-fns t) near the top,
> which causes the ACL2 read-eval-print loop to compile every Lisp
> definition.)
> Thanks --
> -- Matt

Camm Maguire                                            address@hidden
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]