Giter VIP home page Giter VIP logo

green-threads's People

Contributors

orthecreedence avatar thezerobit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

green-threads's Issues

BLACKBIRD::PROMISE-VALUES is Undefined in LWM 7.1

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:

  1. PROMISE-VALUES is an internal accessor function defined in BLACKBIRD-BASE, not exported
  2. Package BLACKBIRD uses BLACKBIRD-BASE, and does not gain access to the internal symbols of BLACKBIRD-BASE
  3. Hence no internal symbol BLACKBIRD::PROMISE-VALUES

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)))

GREEN-THREADS looks unprotected in SMP environments

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.