6 ms·
SBCL Fibers – Lightweight Cooperative Threads
- justinhj 7mo agoThey should be called Anthony Green Threads. Seriously though, great to see.
- matthewfcarlson 7mo agoI personally like the name fiber better than green threads. But everywhere I’ve worked in user space cooperative threads, it’s always been green threads.
- lll-o-lll 7mo agoThey are different things perhaps? Fibers imply strict cooperative behaviour; I have to explicitly “yield” to give the other fibers a go, green threads are just runtime managed threads?
- varjag 7mo agoGreen threads are cooperative threads. Preemption requires ability to handle hardware interrupts, which are typically handled by the OS.
- patrec 7mo agoWhat do you mean by this?
- reverius42 7mo agoEverything purely in userspace is by definition cooperative, because to be non-cooperative, you must dip down below userspace.
- HexDecOctBin 7mo agoIs there a similar document for the memory arena feature? I tried searching the official documentation, but found scant references and no instructions on how and when to use it.
- dmpk2k 7mo agoHuh, you're right. Apparently it's still considered experimental (even though Google uses it in production) so it's not in the User Manual. There's this: https://github.com/sbcl/sbcl/blob/master/doc/internals-notes/arena-allocation.txt https://github.com/sbcl/sbcl/blob/master/doc/internals-notes...
- pestatije 7mo agoSBCL - Steel Bank Common Lisp
- nothrabannosir 7mo agoI strongly recommend having a look at the mailing list to get some context: https://sourceforge.net/p/sbcl/mailman/sbcl-devel/thread/CAF5LJ4CjehsveWi0pCVxEcVBeTR%2BbX-TLbqxYkyuc-R3MVLdww%40mail.gmail.com/#msg59300871 https://sourceforge.net/p/sbcl/mailman/sbcl-devel/thread/CAF... and https://sourceforge.net/p/sbcl/mailman/sbcl-devel/thread/CACxje5-Nwfoe8REix2B8KGksLi31OSW0A32LQbfCccrpM1R1%3DA%40mail.gmail.com/#msg59302483 https://sourceforge.net/p/sbcl/mailman/sbcl-devel/thread/CAC... This will certainly speak to some people taking part in some of the more controversial discussions taking place on HN recently, to put it mildly.
- anonzzzies 7mo agoHmm, must have missed that ; tried to find. There was a SBCL discussion a few days ago but didn't read much controversial things in that? I'm a fanboy though so possibly i'm blind to these things.
- ragall 7mo agoI think he was referring to "Begone, slop men", which is the right answer to this.
- beepbooptheory 7mo agoIdk if I can quite place it but by the time it gets to, "I've created github issues for each section of your reviews.." in the second link its just so infuriating. Just want to shake them and say "for the love of god just talk to them"!
- lukasb 7mo agoSerious question - I thought LLMs were bad at balancing parentheses?
- atgreen 7mo agoThey are much better these days.
- ivanb 7mo agoBesides, one can easily code a skill+script for detecting the problem and suggesting fixes. In my anecdotal experience it cuts down the number of times dumber models walk in circle trying to balance parens.
- cmrdporcupine 7mo agoI had some ideas for extending the lem editor (emacs in common lisp) the other day and I am barely literate in Lisp. So I had Claude Code do it. Fully awesome. No problems. A few paren issues, buit it seemed to not really struggle really. It produced working code. Was also really good at analyzing the lem codebase as well. I even had it write an agentic coding tool in Common Lisp using the RLM ideas: https://alexzhang13.github.io/blog/2025/rlm/ https://alexzhang13.github.io/blog/2025/rlm/ Lisp is a natural fit for this kind of thing. And it worked well. (I also suspect if parens were really a problem... there's room here for MCP or other tooling to help. Basically paredit but for agents)
- smallstepforman 7mo ago256Kb stack per Fiber is still insane overhead compared to Actors. I guess if we survey programming community, I’d guesstimate that less than 2% of devs even know what the Actor model is, and an even smaller percentage have actually used it in production. Any program that has at least one concurrent task that runs on a thread (naturally they’ll be more than one) is a perfect reason to switch to Actor programming model. Even a simple print() function can see performance boost from running on a 2nd core. There is a lot of backround work to print text (parsing font metrics, indexing screen buffers, preparing scene graphs etc) and its really inefficient to block your main application while doing all this work while background cores sit idle. Yet most programmers dont know about this performance boost. Sad state of our education and the industry.
- 20k 7mo agoFibers are primarily when you have a problem which is easily expressible as thread-per-unit-of-work, but you want N > large. They can be useful for eg a job system as well, and in that case the primary advantage is the extremely low context switch time, as well as the manual yielding There are lots of problems where I wouldn't recommend fibers though
- atgreen 7mo ago256k is just's just a placeholder for now. The default will get reduced as we get more experience with the draft implementation. The proposal isn't complete yet.
- my-next-account 7mo agoActors are a model, I have no clue why you're saying that there is a particular memory cost to them on real hardware. To me, you can implement actors using fibers and a postbox. I've no idea what the majority of programmers know or do not know about, but async logging isn't unknown and is supported by libraries like Log4j.
- vitaminCPP 7mo agoYeah that was my also my thought. I always understood that if you give a thread to each actor you get the "active object" design pattern.
- theParadox42 7mo agoI really thought this was gonna be a sick material science paper. Still cool though
- mark_l_watson 7mo agoI am excited by the proposal and early work. SBCL Common Lisp is my second most used programming language - glad to see useful extensions. Most of my recent experiments with SBCL involve tooling to be called by LLMs/agents and high speed tooling to provide LLMs/agents with better long term memory and context. Fibers will be useful for most of that work.
- jjtheblunt 7mo agowhat's your first most used programming language?
- mark_l_watson 7mo agoPython because so much of my paid work in the last decade has been in deep learning.
- nesarkvechnep 7mo agoEvery move in the concurrency direction is good but I really wanted to see preemptive scheduling and Erlang-like processes.
- stainlu 7mo ago[flagged]