sharplispers / lparallel Goto Github PK
View Code? Open in Web Editor NEWThis project forked from lmj/lparallel
Parallelism for Common Lisp
Home Page: http://lparallel.org
License: BSD 3-Clause "New" or "Revised" License
This project forked from lmj/lparallel
Parallelism for Common Lisp
Home Page: http://lparallel.org
License: BSD 3-Clause "New" or "Revised" License
The current implementation of END-KERNEL
isn't sufficient - the threads are not necessarily gone when that function returns.
I'm doing something akin to
(let (...
(lparallel:*kernel* (lparallel:make-kernel 4)))
(format t "Loading...~%")
(lparallel:pmap nil
(lambda (file)
(import-file ...))
...)
(lparallel:end-kernel :wait t))
(save-lisp-and-die ...)
but that (sometimes) breaks with
debugger invoked on a SB-IMPL::SAVE-WITH-MULTIPLE-THREADS-ERROR in thread
#<THREAD tid=3161136 "main thread" RUNNING {1003848003}>:
Cannot save core with multiple threads running.
Interactive thread (of current session):
#<THREAD tid=3161136 "main thread" RUNNING {1003848003}>
Other thread:
#<THREAD "lparallel" FINISHED values: NIL {1069E88B23}>
See also:
The SBCL Manual, Node "Saving a Core Image"
What does seem to help is to use
(map 'nil
#'sb-thread:join-thread
(lparallel:end-kernel :wait t))))
but I guess that should be done in lparallel
proper?!
Thanks!
Hello!
I've found out that stmx integration got broken after lparallel bt2 migration (the latest functional lparallel commit was 80fc2952a074776abd343d6b5d3ab157f0e1df7a
)
Does anyone have any idea on fixing that?
Thought that simply switching bt to api v2 in stmx source code would help, but it doesn't seem to be that straightforward.
minimal reproduceable example:
(deftype unsigned-fixnum () '(integer 0 #.most-positive-fixnum))
(stmx:transactional
(defclass account ()
((balance :initform 0 :initarg :balance :type unsigned-fixnum :accessor account-balance)
(name :initform "" :initarg :name :type string :reader account-name
:transactional nil))))
(defun future-stm ()
(let* ((lparallel:*kernel* (lparallel:make-kernel 4))
(acc (make-instance 'account :name "Mario rossi" :balance 1000)))
(dotimes (i 10) (lparallel:force
(lparallel:future
(stmx:atomic
(when (>= (account-balance acc) 1)
(decf (account-balance acc) 1)
t))
)))))
that works fine before 80fc2952a074776abd343d6b5d3ab157f0e1df7a
, but fails with
(FORMAT NIL "stmx:*current-thread* contains a stale value:~& found ~S~& expecting ~S" #<BT2:THREAD "main thread" {1004AFD8C3}> #<BT2:THREAD "lparallel" {10039C5CD3}>)
afterwards.
@sionescu, maybe you can help here? since you're the expert in bt obviously 🥲
As this repo is ahead of lmj/lparallel, including some bug fixes, maybe it should be added to quicklisp and/or ultralisp?
Original issue: lmj#34
Report:
The documentation string of
task-handler-bind
claims that it works likehandler-bind
but it actually only accepts symbols as condition type specifiers:(lparallel:task-handler-bind (((and error (not undefined-function)) #'continue)) …) => Ill-formed binding in `task-handler-bind': ((AND ERROR (NOT UNDEFINED-FUNCTION)) #'CONTINUE)
Discussion:
none
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.