Disallow thread local concepts to allow fibers move between threads @notl

Sebastiaan Koppe mail at skoppe.eu
Wed Jun 19 19:11:19 UTC 2024


On Monday, 17 June 2024 at 16:37:54 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
>
> On 18/06/2024 4:19 AM, Sebastiaan Koppe wrote:
>> On Saturday, 15 June 2024 at 13:12:12 UTC, Richard (Rikki) 
>> Andrew Cattermole wrote:
> Have you looked at vibe.d eventcore implementation?
>
> Its not IOCP. It is polling everywhere.
>
> Either it gets adapted to IOCP or its stuck with polling and 
> bad performance.

My biggest gripe with it is that its not enabling structured 
concurrency.

> Might as well kick start the eventloop rewrite before we get 
> stackless coroutines.
>
> But that means fibers need to be made "safe" to move between 
> threads.

I don't think the problem is with fibers per se. They can move 
between threads just fine, and TLS variables continue to function 
as designed, that is, they point to the thread local data of the 
thread the fiber happens to be executing on.

Rather, I believe the problem is with assumptions code makes when 
(mis)using TLS data. To that end, can you give me an example of 
code ran on fibers that needs to be made "safe"?

Also, could it be you are trying to do too many things at once? 
Salvaging eventcore, doing an eventloop, fibers _and_ stackless 
coroutines? I see no reason why any of them need to be as coupled 
as suggested.


More information about the dip.ideas mailing list