thezerobit / green-threads Goto Github PK
View Code? Open in Web Editor NEWA lightweight thread / cooperative multitasking library for Common Lisp.
License: Other
A lightweight thread / cooperative multitasking library for Common Lisp.
License: Other
When I try to build today, I get this:
Unhandled UNDEFINED-FUNCTION in thread #<SB-THREAD:THREAD "main thread" RUNNING {1004477613}>: The function BLACKBIRD::PROMISE-VALUES is undefined.
http://report.quicklisp.org/2014-12-09/failure-report/green-threads.html has more context.
There have been a lot of updates to cl-async-future/blackbird recently. Maybe something got out of sync?
On QuickLoad of :GREEN-THREADS in LWM 7.1, I end up with the result:
CL-USER 2 > (ql:quickload :green-threads)
To load "green-threads":
Load 1 ASDF system:
green-threads
; Loading "green-threads"
[package blackbird-base]..........................
[package blackbird-syntax]........................
[package blackbird-util]..........................
[package blackbird]...............................
[package cl-async-future].........................
[package green-threads]..
The following function is undefined:
BLACKBIRD::PROMISE-VALUES which is referenced by GREEN-THREADS:FUTURE-VALUES
Looks like either:
(A) PROMISE-VALUES needs to be exported by BLACKBIRD-BASE and BLACKBIRD (and hence, CL-ASYNC), or else
(B) One should not be referencing an internal symbol from BLACKBIRD in GREEN-THREADS:FUTURE-VALUES.
I can't tell which of these alternatives is the correct one. From browsing the Blackbird docs, there is never any mention of directly referencing the PROMISE-VALUES, which leads me to think there are alternative ways of getting a promise value.
And from reviewing the Green-Threads docs, there doesn't seem to be a case presented where the need for FUTURE-VALUES is manifest.
I'm just getting started perusing the sources to make sense of all of this stuff.
So the issue seems to be that:
So, since GREEN-THREADS is the client referring to BLACKBIRD internal symbols, the corrected form for GT:FUTURE-VALUES is:
(defun future-values (future)
"Returns the values given to the future when it
was completed."
(values-list (blackbird-base::promise-values future)))
It appears that Green Threads are intended to cycle amongst themselves on a single system thread, using THREAD-YIELD to pass control to the next available green thread.
But there is nothing to prevent multiple instances of the same green threads running concurrently on multiple cores in a multi-core SMP system.
This can become inherently unsafe unless the client programmer is fully aware of this situation. There is no warning of this in the current Green Threads documentation.
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.