FORMAT not thread-safe?
Hi,
the following code
---------------------------------------------
(defvar *threads-count* 20)
(defvar *row-count* 12000)
(defvar *template* "Z-test_output.~A")
(defun write-it-z(fname)
(with-open-file (output fname :direction :output :if-does-not-
exist :create :if-exists :supersede :element-type 'character)
(dotimes (i *row-count*)
(format output "~F ~F ~F ~F ~F ~F ~F ~F ~F ~F~%" 1 2 3 4 5 6 7
8 9 10))))
(lw:set-default-character-element-type 'lw:simple-char)
(mp:initialize-multiprocessing)
(defun do-it()
(dotimes (i *threads-count*)
(mp:process-run-function "test-function" '(:priority 3) #'write-
it-z (format nil *template* i))))
(do-it)
-----------------------------------------------
creates files with varying output on all platforms under Lispworks
4.4.6. Does it mean that FORMAT is not thread-safe? Is it intended to
be not thread-safe? If it is not intended, how can it be worked around?
David