Ticket #993: lock-free-hash-table-test-3.lisp

File lock-free-hash-table-test-3.lisp, 628 bytes (added by uchida, 21 months ago)
Line 
1;;(egc nil)
2(configure-egc 64 2048 2048)
3
4(defvar *tbl* (make-hash-table))
5
6(defun run-test ()
7  (dotimes (i 1000)
8    (dotimes (j 100)
9      (let ((k (cons i j)))
10        (print k)
11        (setf (gethash k *tbl*) 0)
12        (setf (gethash k *tbl*) 0)
13        (setf (gethash k *tbl*) 0)))))
14
15(defun ext-proc-thread ()
16  (process-run-function "ext-proc-thread"
17                        #'(lambda ()
18                            (loop
19                               #+LINUX
20                               (sleep 0.01)
21                               (run-program "/bin/echo" nil) ;; On Windows, exit code = 2.
22                               ))))
23
24(ext-proc-thread)
25
26(run-test)