Threading in ECL still seems experimental because it fails some basic
stress tests. I tend to classify thread problems as rather bad because
the door is opened to corruption. Doesn't enabling it by default
communicate the wrong message?

Probably simplest stress test that currently fails is in the last
comment at http://sourceforge.net/p/ecls/bugs/192/

(defun test (message-count thread-count)
  (let ((to-workers (mp:make-semaphore))
        (from-workers (mp:make-semaphore)))
    (loop :repeat thread-count :do
       (mp:process-run-function
        "test"
        (lambda ()
          (loop
             (mp:wait-on-semaphore to-workers)
             (mp:signal-semaphore from-workers)))))
    (loop
       (loop :repeat message-count :do
          (mp:signal-semaphore to-workers))
       (loop :repeat message-count :do
          (mp:wait-on-semaphore from-workers))
       (assert (zerop (mp:semaphore-count to-workers)))
       (assert (zerop (mp:semaphore-count from-workers)))
       (format t ".")
       (finish-output))))

(defun run ()
  (test 10000 64))

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to