Inconsistent loop behaviour when using threads.
Lubwama Abdul Muswawir <[email protected]> Wed, 23 Apr 2025 12:58:52 +0000
| Newsgroups | gmane.lisp.steel-bank.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, I am currently exploring the actor concurrent models in SBCL. The loop macro is behaving wierdly when using threads inside it. Example loop:```(eval-when (:compile-toplevel) (defun test-p () (loop for i from 0 to 1000 do (make-thread (lambda () (format #.*terminal-io* "Working on: ~a~%" i))))))```This will print from 1 to 1001, it will work within expected bounds when I use dolist, when I don't use threads. My use case involves using threads on a range which I intended to generate via loop. This behaviour is consistent with all actor packages (sento, lisp-actors) I have tried because all use sb-thread. _______________________________________________ Sbcl-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sbcl-help