louis,
@louis@emacs.ch avatar

Exciting news for SBCL users. A coroutine proof-of-concept was created during ELS after-hours in a pub :-) I for once hope, what happened in Vienna, doesn't stay in Vienna.

#sbcl #els2024 #commonlisp

spnw,
@spnw@emacs.ch avatar

@louis That's quite possibly the feature I'd most like to see in SBCL.

galdor,
@galdor@emacs.ch avatar

@louis I hope it means green threads (let me dream).

louis,
@louis@emacs.ch avatar

@galdor From what I understood, they took the green thread machinery from CCL and just removed the preemptive scheduler. Does that sound plausible? 🙂

galdor, (edited )
@galdor@emacs.ch avatar

@louis From a quick check in CCL documentation, it used to have cooperative userland multithreading and switched to OS threads in 0.14.

The thing is, naïve cooperative multithreading (i.e. Stackless Python or what some Scheme implementations do with continuations) is pretty much useless without a runtime able to deal with IO (global IO handler with epoll/kqueue, yield on all IO ops and resume on IO events), which is tricky because none of this is defined in the Common Lisp standard.

Also this is 2024, if your green threads cannot be dispatched on multiple cores (as in Go or Erlang), the benefits are more than limited.

Doing all of this really efficiently is a very hard problem, especially if you are a native compiler (now you have potentially millions of green threads, each with a tiny stack, then suddenly you make FFI calls and the C code is convinced you have your 4+MiB of stack…).

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • khanakhh
  • DreamBathrooms
  • ethstaker
  • thenastyranch
  • tester
  • magazineikmin
  • Durango
  • GTA5RPClips
  • Youngstown
  • slotface
  • ngwrru68w68
  • kavyap
  • tacticalgear
  • everett
  • provamag3
  • InstantRegret
  • cisconetworking
  • Leos
  • normalnudes
  • rosin
  • mdbf
  • cubers
  • osvaldo12
  • megavids
  • anitta
  • modclub
  • JUstTest
  • lostlight
  • All magazines