[Ecls-list] Threading as default feature

Anton Vodonosov avodonosov at yandex.ru
Wed Jun 12 12:41:40 UTC 2013


12.06.2013, 09:18, "James M. Lawrence" <llmjjmll at gmail.com>:
> 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))
>

In my opinion, it's better to have threading enabled by default.






More information about the ecl-devel mailing list